Skip to content
Chat & AI

Prompt Input

Composer with attachments, tools, speech, and submit/stop.

Import

tsx
import { PromptInput } from "@cronus-ui/ui";
bash
npx cronus-ui add prompt-input

Examples

.cronus

The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.

PortedParity: MatchGeometry 1/1Pixel diff 0 pxLogic 1/1Parity scoreboard
default.cronus
app "audit-fixtures" {
  port 5176
}

style {
  preset aurora
  theme dark
}

component PromptInputDefault layout:inline style:prompt-input {
  action:"/chat"
  method:"post"
  label "What would you like to know?"
  text "What would you like to know?"
}

page "/audit/prompt-input/default" type:custom {
  use PromptInputDefault
}

API Reference

Generated from the component's exported types.

PromptInputLabels

Skip PromptInputLabels props table
PropTypeDefaultDescription
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

Skip PromptInputControllerProps props table
PropTypeDefaultDescription
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; }>

Skip PromptInputProviderProps props table
PropTypeDefaultDescription
children
ReactNode—Contents of the component.
initialInput
string—Seed value for the prompt field.

PromptInputAttachmentProps

Extends HTMLAttributes<HTMLDivElement>

Skip PromptInputAttachmentProps props table
PropTypeDefaultDescription
data*
FileUIPart & { id: string }——
className
string—Additional class names merged onto the root.
children
ReactNode—Contents of the component.
id
string—DOM id of the root element.

PromptInputAttachmentsProps

Extends Omit<HTMLAttributes<HTMLDivElement>, "children">

Skip PromptInputAttachmentsProps props table
PropTypeDefaultDescription
children*
(attachment: FileUIPart & { id: string }) => ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.
id
string—DOM id of the root element.

PromptInputActionAddAttachmentsProps

Extends ComponentProps<typeof DropdownMenuItem>

Skip PromptInputActionAddAttachmentsProps props table
PropTypeDefaultDescription
label
string——
disabled
boolean—Disables pointer and keyboard interaction.
onSelect
(event: Event) => void—Called when the item is chosen.
textValue
string—Text used for typeahead. Defaults to the item's text.
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

PromptInputProps

Extends Omit<HTMLAttributes<HTMLFormElement>, "onSubmit" | "onError">

Skip PromptInputProps props table
PropTypeDefaultDescription
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.
className
string—Additional class names merged onto the root.
children
ReactNode—Contents of the component.
id
string—DOM id of the root element.

PromptInputBodyProps

Extends HTMLAttributes<HTMLDivElement>

Skip PromptInputBodyProps props table
PropTypeDefaultDescription
className
string—Additional class names merged onto the root.
children
ReactNode—Contents of the component.
id
string—DOM id of the root element.

PromptInputTextareaProps

Extends ComponentProps<typeof Textarea>

Skip PromptInputTextareaProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

PromptInputHeaderProps

Extends HTMLAttributes<HTMLDivElement>

Skip PromptInputHeaderProps props table
PropTypeDefaultDescription
className
string—Additional class names merged onto the root.
children
ReactNode—Contents of the component.
id
string—DOM id of the root element.

PromptInputFooterProps

Extends HTMLAttributes<HTMLDivElement>

Skip PromptInputFooterProps props table
PropTypeDefaultDescription
className
string—Additional class names merged onto the root.
children
ReactNode—Contents of the component.
id
string—DOM id of the root element.

PromptInputToolsProps

Extends HTMLAttributes<HTMLDivElement>

Skip PromptInputToolsProps props table
PropTypeDefaultDescription
className
string—Additional class names merged onto the root.
children
ReactNode—Contents of the component.
id
string—DOM id of the root element.

PromptInputButtonProps

Extends ComponentProps<typeof Button>

Skip PromptInputButtonProps props table
PropTypeDefaultDescription
variant
string—Visual variant.
size
string—Control size.
asChild
boolean—Render as the child element via Slot.
disabled
boolean—Disables pointer and keyboard interaction.
type
string—Native type of the underlying element.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

PromptInputActionMenuProps

Extends ComponentProps<typeof DropdownMenu>

Skip PromptInputActionMenuProps props table
PropTypeDefaultDescription
open
boolean—Controlled open state.
defaultOpen
boolean—Uncontrolled initial open state.
onOpenChange
(open: boolean) => void—Called when the open state changes.
children
ReactNode—Contents of the component.
modal
boolean—When true, interaction outside the surface is blocked.

PromptInputActionMenuTriggerProps

Extends ComponentProps<typeof Button>

Skip PromptInputActionMenuTriggerProps props table
PropTypeDefaultDescription
variant
string—Visual variant.
size
string—Control size.
asChild
boolean—Render as the child element via Slot.
disabled
boolean—Disables pointer and keyboard interaction.
type
string—Native type of the underlying element.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

PromptInputActionMenuContentProps

Extends ComponentProps<typeof DropdownMenuContent>

Skip PromptInputActionMenuContentProps props table
PropTypeDefaultDescription
side
"top" | "right" | "bottom" | "left"—Preferred side of the trigger.
align
"start" | "center" | "end"—Alignment along the chosen side.
sideOffset
number—Distance in pixels from the trigger.
alignOffset
number—Offset along the alignment axis.
forceMount
boolean—Keep the node mounted when closed, for exit animation.
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

PromptInputActionMenuItemProps

Extends ComponentProps<typeof DropdownMenuItem>

Skip PromptInputActionMenuItemProps props table
PropTypeDefaultDescription
disabled
boolean—Disables pointer and keyboard interaction.
onSelect
(event: Event) => void—Called when the item is chosen.
textValue
string—Text used for typeahead. Defaults to the item's text.
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

PromptInputSubmitProps

Extends ComponentProps<typeof Button>

Skip PromptInputSubmitProps props table
PropTypeDefaultDescription
status
ChatStatus——
variant
string—Visual variant.
size
string—Control size.
asChild
boolean—Render as the child element via Slot.
disabled
boolean—Disables pointer and keyboard interaction.
type
string—Native type of the underlying element.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

PromptInputSpeechButtonProps

Extends ComponentProps<typeof PromptInputButton>

Skip PromptInputSpeechButtonProps props table
PropTypeDefaultDescription
textareaRef
RefObject<HTMLTextAreaElement | null>——
onTranscriptionChange
(text: string) => void——
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

PromptInputModelSelectProps

Extends ComponentProps<typeof Select>

Skip PromptInputModelSelectProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

PromptInputModelSelectTriggerProps

Extends ComponentProps<typeof SelectTrigger>

Skip PromptInputModelSelectTriggerProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

PromptInputModelSelectValueProps

Extends ComponentProps<typeof SelectValue>

Skip PromptInputModelSelectValueProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

PromptInputModelSelectContentProps

Extends ComponentProps<typeof SelectContent>

Skip PromptInputModelSelectContentProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

PromptInputModelSelectItemProps

Extends ComponentProps<typeof SelectItem>

Skip PromptInputModelSelectItemProps props table
PropTypeDefaultDescription
value
string—Controlled value.
disabled
boolean—Disables pointer and keyboard interaction.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

PromptInputHoverCardProps

Extends ComponentProps<typeof HoverCard>

Skip PromptInputHoverCardProps props table
PropTypeDefaultDescription
open
boolean—Controlled open state.
defaultOpen
boolean—Uncontrolled initial open state.
onOpenChange
(open: boolean) => void—Called when the open state changes.
children
ReactNode—Contents of the component.

PromptInputHoverCardTriggerProps

Extends ComponentProps<typeof HoverCardTrigger>

Skip PromptInputHoverCardTriggerProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

PromptInputHoverCardContentProps

Extends ComponentProps<typeof HoverCardContent>

Skip PromptInputHoverCardContentProps props table
PropTypeDefaultDescription
side
"top" | "right" | "bottom" | "left"—Preferred side of the trigger.
align
"start" | "center" | "end"—Alignment along the chosen side.
sideOffset
number—Distance in pixels from the trigger.
alignOffset
number—Offset along the alignment axis.
forceMount
boolean—Keep the node mounted when closed, for exit animation.
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

PromptInputTabsListProps

Extends HTMLAttributes<HTMLDivElement>

Skip PromptInputTabsListProps props table
PropTypeDefaultDescription
className
string—Additional class names merged onto the root.
children
ReactNode—Contents of the component.
id
string—DOM id of the root element.

PromptInputTabProps

Extends HTMLAttributes<HTMLDivElement>

Skip PromptInputTabProps props table
PropTypeDefaultDescription
className
string—Additional class names merged onto the root.
children
ReactNode—Contents of the component.
id
string—DOM id of the root element.

PromptInputTabLabelProps

Extends HTMLAttributes<HTMLHeadingElement>

Skip PromptInputTabLabelProps props table
PropTypeDefaultDescription
className
string—Additional class names merged onto the root.
children
ReactNode—Contents of the component.
id
string—DOM id of the root element.

PromptInputTabBodyProps

Extends HTMLAttributes<HTMLDivElement>

Skip PromptInputTabBodyProps props table
PropTypeDefaultDescription
className
string—Additional class names merged onto the root.
children
ReactNode—Contents of the component.
id
string—DOM id of the root element.

PromptInputTabItemProps

Extends HTMLAttributes<HTMLDivElement>

Skip PromptInputTabItemProps props table
PropTypeDefaultDescription
className
string—Additional class names merged onto the root.
children
ReactNode—Contents of the component.
id
string—DOM id of the root element.

PromptInputCommandProps

Extends ComponentProps<typeof Command>

Skip PromptInputCommandProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

PromptInputCommandInputProps

Extends ComponentProps<typeof CommandInput>

Skip PromptInputCommandInputProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

PromptInputCommandListProps

Extends ComponentProps<typeof CommandList>

Skip PromptInputCommandListProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

PromptInputCommandEmptyProps

Extends ComponentProps<typeof CommandEmpty>

Skip PromptInputCommandEmptyProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

PromptInputCommandGroupProps

Extends ComponentProps<typeof CommandGroup>

Skip PromptInputCommandGroupProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

PromptInputCommandItemProps

Extends ComponentProps<typeof CommandItem>

Skip PromptInputCommandItemProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

PromptInputCommandSeparatorProps

Extends ComponentProps<typeof CommandSeparator>

Skip PromptInputCommandSeparatorProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.