Prompt Bar
ProNewNext-gen AI composer with @ context sources, / slash commands, a model picker, and a pulsing dictation toggle.
Installation
pnpm dlx shadcn@latest add @viewport/prompt-bar
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
The code behind the preview above comes with Truffle Pro.
Props
| Prop | Type | Default |
|---|---|---|
| sources | PromptSource[]Items offered after typing `@`. | [] |
| commands | PromptCommand[]Items offered after typing `/`. | [] |
| models | PromptModel[]Models in the picker. The first is selected by default. | [] |
| onSubmit | (prompt: string, sourceIds: string[], modelId: string) => voidCalled with the prompt, the attached source ids, and the model id. | — |
| placeholder | string | "Ask, @ to add context, / for commands" |
| className | string | — |
Accessibility
- Implements the combobox pattern with aria-expanded, aria-controls, and aria-activedescendant.
- Arrow keys, Tab, Enter, and Escape navigate and select popover items without leaving the textarea.
- Attached source chips have individual remove buttons; motion respects prefers-reduced-motion.