API reference: @salmonui/chat/conversation
ConversationComposerPropsinterface
import type { ConversationComposerProps } from '@salmonui/chat/conversation';interface ConversationComposerProps {
readonly placeholder?: string;
readonly value?: string;
readonly defaultValue?: string;
readonly onValueChange?: (value: string) => void;
readonly clearable?: boolean;
readonly disabled?: boolean;
readonly rows?: number;
readonly mentions?: readonly ConversationMentionConfig[];
readonly onBeforeMentionSelect?: (event: ConversationBeforeMentionSelectEvent) => void;
readonly onMentionSelect?: (event: ConversationMentionSelectEvent) => void;
readonly attachments?: boolean | ConversationAttachmentOptions;
readonly onBeforeAttach?: (event: ConversationBeforeAttachEvent) => void;
readonly onAttach?: (event: ConversationAttachEvent) => void;
readonly onAttachmentRemove?: (event: ConversationAttachmentEvent) => void;
readonly onAttachmentError?: (error: ConversationAttachmentError) => void;
readonly toolbar?: ReactNode;
readonly className?: string;
readonly style?: CSSProperties;
}
| Name | Signature | Description |
|---|---|---|
placeholderoptional | readonly placeholder?: string; | |
valueoptional | readonly value?: string; | Controlled draft. |
defaultValueoptional | readonly defaultValue?: string; | |
onValueChangeoptional | readonly onValueChange?: (value: string) => void; | |
clearableoptional | readonly clearable?: boolean; | Shows a clear button while there is a draft. |
disabledoptional | readonly disabled?: boolean; | |
rowsoptional | readonly rows?: number; | Visible rows of the textarea (default 1; it grows with content). |
mentionsoptional | readonly mentions?: readonly ConversationMentionConfig[]; | |
onBeforeMentionSelectoptional | readonly onBeforeMentionSelect?: (event: ConversationBeforeMentionSelectEvent) => void; | |
onMentionSelectoptional | readonly onMentionSelect?: (event: ConversationMentionSelectEvent) => void; | |
attachmentsoptional | readonly attachments?: boolean | ConversationAttachmentOptions; | Enables attachments ( |
onBeforeAttachoptional | readonly onBeforeAttach?: (event: ConversationBeforeAttachEvent) => void; | |
onAttachoptional | readonly onAttach?: (event: ConversationAttachEvent) => void; | |
onAttachmentRemoveoptional | readonly onAttachmentRemove?: (event: ConversationAttachmentEvent) => void; | |
onAttachmentErroroptional | readonly onAttachmentError?: (error: ConversationAttachmentError) => void; | |
toolbaroptional | readonly toolbar?: ReactNode; | Extra controls next to the send button. |
classNameoptional | readonly className?: string; | |
styleoptional | readonly style?: CSSProperties; |