Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Prompt Bar

ProNew

Next-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

PropTypeDefault
sourcesPromptSource[]

Items offered after typing `@`.

[]
commandsPromptCommand[]

Items offered after typing `/`.

[]
modelsPromptModel[]

Models in the picker. The first is selected by default.

[]
onSubmit(prompt: string, sourceIds: string[], modelId: string) => void

Called with the prompt, the attached source ids, and the model id.

—
placeholderstring"Ask, @ to add context, / for commands"
classNamestring—

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.