Command Bar
betaA compact one-row prompt bar — auto-growing field, dictate toggle and send — composed from AI Prompt Input.
- AI
- 1 file
- 1 npm package
- Accessibility notes
Loading the example…
pnpm dlx @dowel-ui/cli add command-barnpm packages installed: class-variance-authority.
import { CommandBar } from "@/components/ui/command-bar";Default
Gallery
<CommandBar>
| Prop | Type | Default |
|---|---|---|
defaultDictating | boolean | false |
defaultValue | string | "" |
dictateLabel | string | "Dictate" |
dictatingWhether dictation is on. Omit | boolean | — |
labelThe field's accessible name. | string | "Message" |
leadingSlot before the field, e.g. an attach button. | ReactNode | — |
maxRowsRows the field grows to before scrolling. | number | 6 |
onDictatingChange | (dictating: boolean) => void | — |
onSendCalled with the trimmed text. An uncontrolled bar then clears itself. | (value: string) => void | — |
onStop | () => void | — |
onValueChange | (value: string) => void | — |
placeholder | string | "Ask anything…" |
sendingA send is in flight: sending is blocked and the button becomes Stop. | boolean | false |
sendLabel | string | "Send" |
shape | "pill" | "rounded" | "pill" |
stopLabel | string | "Stop" |
value | string | — |
Inherits AI Prompt Input's behaviour: Enter sends, Shift+Enter adds a newline, never mid-IME-composition, and the submit control renames itself to "Stop" while sending. The field is named by `label`. Send is disabled while the field is empty. Dictate is a toggle button (aria-pressed); the consumer owns the microphone.
10/10
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — passes
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — passes
- No fixed widths — passes