PromptArea Props
Complete reference for PromptAreaProps. The component is controlled — value and onChange are required (the state hook provides both via bind).
Core
| Prop | Type | Default | Description |
|---|---|---|---|
value | Segment[] | — | The document segments (controlled). |
onChange | (segments: Segment[]) => void | — | Called when the content changes. |
triggers | TriggerConfig[] | — | Trigger configurations for @mentions, /commands, #tags, and callbacks. |
placeholder | string | string[] | — | Placeholder text. Pass an array to animate between several. |
markdown | boolean | — | Render inline markdown (bold, italic, URLs, lists). |
disabled | boolean | false | Whether the input is disabled. |
className | string | — | Additional CSS class for the container. |
Sizing & focus
| Prop | Type | Default | Description |
|---|---|---|---|
minHeight | number | 80 | Minimum height in pixels. |
maxHeight | number | — | Maximum height in pixels. |
autoGrow | boolean | false | Grow to fit content on focus, shrink on blur. |
autoFocus | boolean | — | Auto-focus on mount. |
'aria-label' | string | — | Accessible label for the input. |
Event callbacks
| Prop | Type | Default | Description |
|---|---|---|---|
onSubmit | (segments: Segment[]) => void | — | Enter pressed without Shift. |
onEscape | () => void | — | Escape pressed. |
onChipClick | (chip: ChipSegment) => void | — | A chip element was clicked. |
onChipAdd | (chip: ChipSegment) => void | — | A chip was added (selection, auto-resolve, paste, or insert). |
onChipDelete | (chip: ChipSegment) => void | — | A chip was deleted (backspace or forward delete). |
onLinkClick | (url: string) => void | — | A URL link was clicked. |
onPaste | (data: { segments; source }) => void | — | Content pasted; source is 'internal' | 'external'. |
onUndo / onRedo | (segments: Segment[]) => void | — | After an undo or redo, with the restored segments. |
Attachments
| Prop | Type | Default | Description |
|---|---|---|---|
images | PromptAreaImage[] | — | Image attachments to display. |
imagePosition | 'above' | 'below' | 'above' | Where the image strip renders. |
onImagePaste | (file: File) => void | — | An image was pasted from the clipboard. |
files | PromptAreaFile[] | — | File attachments to display. |
filePosition | 'above' | 'below' | 'above' | Where the file strip renders. |
onImageRemove / onFileRemove | (item) => void | — | The remove button on an attachment was clicked. |
Imperative handle
Attach a ref to access PromptAreaHandle:
| Prop | Type | Default | Description |
|---|---|---|---|
focus() | () => void | — | Focus the editable area. |
blur() | () => void | — | Blur the editable area. |
insertChip() | (chip: Omit<ChipSegment, 'type'>) => void | — | Insert a chip at the cursor. |
getPlainText() | () => string | — | Current plain text. |
clear() | () => void | — | Clear all content. |