Docs · PromptArea Props

PromptArea Props

Complete reference for PromptAreaProps. The component is controlled — value and onChange are required (the state hook provides both via bind).

Core

PropTypeDefaultDescription
valueSegment[]The document segments (controlled).
onChange(segments: Segment[]) => voidCalled when the content changes.
triggersTriggerConfig[]Trigger configurations for @mentions, /commands, #tags, and callbacks.
placeholderstring | string[]Placeholder text. Pass an array to animate between several.
markdownbooleanRender inline markdown (bold, italic, URLs, lists).
disabledbooleanfalseWhether the input is disabled.
classNamestringAdditional CSS class for the container.

Sizing & focus

PropTypeDefaultDescription
minHeightnumber80Minimum height in pixels.
maxHeightnumberMaximum height in pixels.
autoGrowbooleanfalseGrow to fit content on focus, shrink on blur.
autoFocusbooleanAuto-focus on mount.
'aria-label'stringAccessible label for the input.

Event callbacks

PropTypeDefaultDescription
onSubmit(segments: Segment[]) => voidEnter pressed without Shift.
onEscape() => voidEscape pressed.
onChipClick(chip: ChipSegment) => voidA chip element was clicked.
onChipAdd(chip: ChipSegment) => voidA chip was added (selection, auto-resolve, paste, or insert).
onChipDelete(chip: ChipSegment) => voidA chip was deleted (backspace or forward delete).
onLinkClick(url: string) => voidA URL link was clicked.
onPaste(data: { segments; source }) => voidContent pasted; source is 'internal' | 'external'.
onUndo / onRedo(segments: Segment[]) => voidAfter an undo or redo, with the restored segments.

Attachments

PropTypeDefaultDescription
imagesPromptAreaImage[]Image attachments to display.
imagePosition'above' | 'below''above'Where the image strip renders.
onImagePaste(file: File) => voidAn image was pasted from the clipboard.
filesPromptAreaFile[]File attachments to display.
filePosition'above' | 'below''above'Where the file strip renders.
onImageRemove / onFileRemove(item) => voidThe remove button on an attachment was clicked.

Imperative handle

Attach a ref to access PromptAreaHandle:

PropTypeDefaultDescription
focus()() => voidFocus the editable area.
blur()() => voidBlur the editable area.
insertChip()(chip: Omit<ChipSegment, 'type'>) => voidInsert a chip at the cursor.
getPlainText()() => stringCurrent plain text.
clear()() => voidClear all content.