Prompt

A component that renders an input prompt.

Basic example

1import { ChatView } from '@markprompt/react';
2
3function Example() {
4  return <Prompt buttonLabel="Send" showSubmitButton />;
5}

Component API

Prop Type Description
label ReactNode

The label for the input.

labelClassName string

The class name of the label element.

textAreaContainerClassName string

The class name of the text area container.

sendButtonClassName string

The class name of the send button element.

buttonLabel string

The label for the submit button.

showSubmitButton boolean

Show an icon next to the send button.

isLoading boolean

If the answer is loading.

Icon ReactNode

Icon for the button.

minRows number

Minimum number of rows.

onSubmit FormEventHandler<HTMLFormElement>

Use an input field instead of a text area.

submitOnEnter boolean

Submit on enter.