Voice Input
betaA microphone toggle for talking to an assistant: records, shows what the mic hears and for how long, and streams a live transcript where the browser can.
- AI
- 1 file
- No extra npm packages
- Accessibility notes
- Draws on a canvas
pnpm dlx @dowel-ui/cli add voice-inputNo npm packages are needed beyond what Dowel already requires.
import { VoiceInput } from "@/components/ui/voice-input";Default
With Transcript
<VoiceInput>
| Prop | Type | Default |
|---|---|---|
disabled | boolean | false |
labelThe button's accessible name. Default "Voice input". | string | "Voice input" |
langLanguage for transcription, e.g. "en-GB". Defaults to the page's. | string | — |
maxDurationStop on their own after this many seconds. | number | — |
messagesWords, for other languages. | Partial<VoiceInputMessages> | — |
onErrorTold about anything that went wrong; the message is also shown. | (error: VoiceInputError) => void | — |
onRecordingChangeTold when recording starts and stops. | (recording: boolean) => void | — |
onRecordingCompleteCalled with the recorded audio when a recording ends (not when it is cancelled). | (audio: Blob, durationMs: number) => void | — |
onTranscriptThe transcript so far, and whether this part is final. | (text: string, isFinal: boolean) => void | — |
transcribeStream a live transcript through | boolean | false |
visualizerHow the visualizer draws. Default "bars". | "bars" | "wave" | "orb" | "bars" |
Plus every attribute of <div> except onError.
7/7
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — does not apply
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — does not apply
- className merged — passes
- Visible focus — does not apply
- No fixed widths — passes