Prompt Input
Composer with attachments, tools, speech, and submit/stop.
Import
import { PromptInput } from "@cronus-ui/ui";
npx cronus-ui add prompt-input
Examples
API Reference
Generated from the component's exported types.
PromptInputLabels
| Prop | Type | Default | Description |
|---|---|---|---|
upload | string | — | — |
removeAttachment | string | — | — |
unknownFile | string | — | — |
addAttachments | string | — | — |
submit | string | — | — |
stop | string | — | — |
placeholder | string | — | Placeholder shown when the value is empty. |
speech | string | — | — |
speechStop | string | — | — |
errorAccept | string | — | — |
errorMaxFileSize | string | — | — |
errorMaxFiles | string | — | — |
PromptInputControllerProps
| Prop | Type | Default | Description |
|---|---|---|---|
textInput* | TextInputContext | — | — |
attachments* | AttachmentsContext | — | — |
__registerFileInput* | (ref: RefObject<HTMLInputElement | null>, open: () => void) => void | — | INTERNAL: Allows PromptInput to register its file input + "open" callback |
PromptInputProviderProps
Extends PropsWithChildren<{ initialInput?: string; }>
No own props — see the extended type above for available props.
PromptInputAttachmentProps
Extends HTMLAttributes<HTMLDivElement>
| Prop | Type | Default | Description |
|---|---|---|---|
data* | FileUIPart & { id: string } | — | — |
className | string | — | Additional class names merged onto the root. |
PromptInputAttachmentsProps
Extends Omit<HTMLAttributes<HTMLDivElement>, "children">
| Prop | Type | Default | Description |
|---|---|---|---|
children* | (attachment: FileUIPart & { id: string }) => ReactNode | — | Contents of the component. |
PromptInputActionAddAttachmentsProps
Extends ComponentProps<typeof DropdownMenuItem>
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | — | — |
PromptInputProps
Extends Omit<HTMLAttributes<HTMLFormElement>, "onSubmit" | "onError">
| Prop | Type | Default | Description |
|---|---|---|---|
ref | Ref<HTMLFormElement> | — | Ref forwarded to the underlying DOM node. |
accept | string | — | — |
multiple | boolean | — | — |
globalDrop | boolean | — | — |
syncHiddenInput | boolean | — | — |
maxFiles | number | — | — |
maxFileSize | number | — | — |
onError | (err: { code: "max_files" | "max_file_size" | "accept"; message: string }) => void | — | — |
onSubmit* | ( message: PromptInputMessage, event: FormEvent<HTMLFormElement>, ) => void | Promise<void> | — | — |
labels | PromptInputLabels | — | Override default English strings. |
PromptInputBodyProps
Extends HTMLAttributes<HTMLDivElement>
No own props — see the extended type above for available props.
PromptInputTextareaProps
Extends ComponentProps<typeof Textarea>
No own props — see the extended type above for available props.
PromptInputHeaderProps
Extends HTMLAttributes<HTMLDivElement>
No own props — see the extended type above for available props.
PromptInputFooterProps
Extends HTMLAttributes<HTMLDivElement>
No own props — see the extended type above for available props.
PromptInputToolsProps
Extends HTMLAttributes<HTMLDivElement>
No own props — see the extended type above for available props.
PromptInputButtonProps
Extends ComponentProps<typeof Button>
No own props — see the extended type above for available props.
PromptInputActionMenuProps
Extends ComponentProps<typeof DropdownMenu>
No own props — see the extended type above for available props.
PromptInputActionMenuTriggerProps
No own props — see the extended type above for available props.
PromptInputActionMenuContentProps
Extends ComponentProps<typeof DropdownMenuContent>
No own props — see the extended type above for available props.
PromptInputActionMenuItemProps
Extends ComponentProps<typeof DropdownMenuItem>
No own props — see the extended type above for available props.
PromptInputSubmitProps
Extends ComponentProps<typeof Button>
| Prop | Type | Default | Description |
|---|---|---|---|
status | ChatStatus | — | — |
PromptInputSpeechButtonProps
Extends ComponentProps<typeof PromptInputButton>
| Prop | Type | Default | Description |
|---|---|---|---|
textareaRef | RefObject<HTMLTextAreaElement | null> | — | — |
onTranscriptionChange | (text: string) => void | — | — |
PromptInputModelSelectProps
Extends ComponentProps<typeof Select>
No own props — see the extended type above for available props.
PromptInputModelSelectTriggerProps
Extends ComponentProps<typeof SelectTrigger>
No own props — see the extended type above for available props.
PromptInputModelSelectValueProps
Extends ComponentProps<typeof SelectValue>
No own props — see the extended type above for available props.
PromptInputModelSelectContentProps
Extends ComponentProps<typeof SelectContent>
No own props — see the extended type above for available props.
PromptInputModelSelectItemProps
Extends ComponentProps<typeof SelectItem>
No own props — see the extended type above for available props.
PromptInputHoverCardProps
Extends ComponentProps<typeof HoverCard>
No own props — see the extended type above for available props.
PromptInputHoverCardTriggerProps
Extends ComponentProps<typeof HoverCardTrigger>
No own props — see the extended type above for available props.
PromptInputHoverCardContentProps
Extends ComponentProps<typeof HoverCardContent>
No own props — see the extended type above for available props.
PromptInputTabsListProps
Extends HTMLAttributes<HTMLDivElement>
No own props — see the extended type above for available props.
PromptInputTabProps
Extends HTMLAttributes<HTMLDivElement>
No own props — see the extended type above for available props.
PromptInputTabLabelProps
Extends HTMLAttributes<HTMLHeadingElement>
No own props — see the extended type above for available props.
PromptInputTabBodyProps
Extends HTMLAttributes<HTMLDivElement>
No own props — see the extended type above for available props.
PromptInputTabItemProps
Extends HTMLAttributes<HTMLDivElement>
No own props — see the extended type above for available props.
PromptInputCommandProps
Extends ComponentProps<typeof Command>
No own props — see the extended type above for available props.
PromptInputCommandInputProps
Extends ComponentProps<typeof CommandInput>
No own props — see the extended type above for available props.
PromptInputCommandListProps
Extends ComponentProps<typeof CommandList>
No own props — see the extended type above for available props.
PromptInputCommandEmptyProps
Extends ComponentProps<typeof CommandEmpty>
No own props — see the extended type above for available props.
PromptInputCommandGroupProps
Extends ComponentProps<typeof CommandGroup>
No own props — see the extended type above for available props.
PromptInputCommandItemProps
Extends ComponentProps<typeof CommandItem>
No own props — see the extended type above for available props.
PromptInputCommandSeparatorProps
Extends ComponentProps<typeof CommandSeparator>
No own props — see the extended type above for available props.