Prompt Bar

Compound prompt input with tool selection and submission.

Installation

npx shadcn@latest add https://brainframeui.tech/r/prompt-bar.json

Props

PromptBar
PropTypeDefaultDescription
payloadPromptPayloadRequiredCurrent prompt and selected tool.
setPayloadDispatch<SetStateAction<PromptPayload>>RequiredUpdates the prompt and selected tool.
isLoadingbooleanRequiredDisables submission while loading.
onSubmit(payload: PromptPayload) => voidRequiredHandles prompt submission.
toolsTool[]RequiredTools available through slash commands.
childrenReactNodeRequiredComposes the prompt bar interface.
classNamestringundefinedAdditional container styles.
ToolMenu
PropTypeDefaultDescription
childrenReactElement<ToolItemProps>RequiredTool item template cloned for each result.
classNamestringundefinedAdditional menu styles.
ToolItem
PropTypeDefaultDescription
idstringundefinedTool identifier assigned on selection.
titlestringundefinedTool name shown in the menu.
descriptionstringundefinedSupporting text shown beside the name.
iconLucideIconundefinedIcon shown beside the tool name.
colorstringundefinedIcon and selected-tool color classes.
indexnumber0Menu position used for selection and animation.
classNamestringundefinedAdditional item styles.
PromptInput
PropTypeDefaultDescription
childrenReactNodeRequiredTextarea and action controls.
classNamestringundefinedAdditional input container styles.
PromptInputTextArea
PropTypeDefaultDescription
placeholderstringRequiredTextarea placeholder text.
classNamestringundefinedAdditional textarea styles.
PromptInputActions
PropTypeDefaultDescription
childrenReactNodeRequiredAttachment and submit controls.
classNamestringundefinedAdditional action row styles.
PromptInputAttachments
PropTypeDefaultDescription
classNamestringundefinedAdditional attachment button styles.
PromptInputSubmit
PropTypeDefaultDescription
classNamestringundefinedAdditional submit control styles.