Dictation Input
A standard text field which allows for voice dictation. The summary is written into the same field. User can decide if they want to send the full recording along with the text.
An example that plays on its own: the mic is pressed, a voice is recorded, and the written answer appears in the field.
- 1
Type as usual
The input acts as a standard text field, with voice input on top.
- 2
Press and talk
Click the button and start dictating. A live waveform shows that the microphone is recording. If needed, you can change the input from a dropdown. Press stop to finish.
- 3
Summarized as text
Your server transcribes the recording, and the summary is written into the field, ready to edit. A player under it plays the recording back.
- 4
Choose what's sent
Pick whether to send the recording along with the text. This option can be forced or disabled through the component's props.
States
Installation
Copy this into your coding agent. It points the agent at the Dictation Input skill and the component, and the agent does the rest.
- 1
Scans your repo
Reads your shadcn setup, the forms and fields where voice fits, your API, database and storage, and any instructions you gave it. Changes nothing.
- 2
Asks for your OK
Sends a short plan: registry or manual install and why, which fields get the mic, how transcription and recordings fit your backend, new env vars. Then waits.
- 3
Implements it
Installs the component, puts the mic on the agreed fields, builds the transcription route and the don't-send-recordings handling, and checks it works.
Add the Dictation Input component from Launch Studio Labs to my app. Skill (follow it): https://labs.launchstudio.space/skills/dictation-input/SKILL.md Component (shadcn registry item): https://labs.launchstudio.space/r/dictation-input.json
Usage
import { DictationInput, VoiceTranscriptionError } from "@/components/ui/dictation-input"
const transcribe = async (take, { sendRecording, signal }) => { const form = new FormData() form.set("file", take.blob) form.set("keep_audio", sendRecording ? "1" : "0") const res = await fetch("/api/voice", { method: "POST", body: form, signal }) if (!res.ok) throw new VoiceTranscriptionError("failed") return res.json() // { transcript, audioId }}
// Wrap the field your form already has.<DictationInput value={answer} onValueChange={setAnswer} onTranscribe={transcribe} onDeleteRecording={(result) => fetch(`/api/voice/${result.audioId}`, { method: "DELETE" }) }> <Textarea value={answer} onChange={(e) => setAnswer(e.target.value)} /></DictationInput>
// A single-line field works the same way.<DictationInput value={name} onValueChange={setName} onTranscribe={transcribe}> <Input value={name} onChange={(e) => setName(e.target.value)} /></DictationInput>API Reference
DictationInput
The field with the mic in its corner. Every other prop goes to the root element.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Required. Your shadcn Input or Textarea. The mic goes in its corner. |
value | string | - | The field's text, the same value you give the field. |
onValueChange | (value: string) => void | - | A transcript was written in, or the answer reset: the field's new text. |
insert | "replace" | "append" | "replace" | Whether the transcript replaces the text or follows it. Reset restores the earlier text. |
disabled | boolean | false | Disables the mic. The field stays usable. |
onTranscribe | VoiceTranscribe | - | Turns a take into text: (take, { sendRecording, signal }) => { transcript, audioId }. Leave it out for a mic that only records. |
onResult | (result: VoiceResult) => void | - | A transcript landed. audio is null when the recording was withheld. |
maxDurationMs | number | 300000 | The longest take. Match it to your server's body limit. |
recordingPolicy | "ask" | "always" | "never" | "ask" | Whether recordings go along with the transcript. "ask": a line inside the field lets the person choose. "always": always sent, and the line says so. "never": transcribed, then thrown away, with no line and no player. |
sendRecording | boolean | - | Controlled: the person's choice, with recordingPolicy="ask". Starts on sending when left out. When false, the server transcribes and throws the recording away. |
onSendRecordingChange | (send: boolean) => void | - | The person changed the choice in the line inside the field. |
onDeleteRecording | (result: VoiceResult) => void | Promise<void> | - | Stored audio must go: on reset, a new take, or sending turned off. Called only with an audioId. Reject to show "couldn't delete". |
onActiveChange | (active: boolean) => void | - | Recording started or stopped, to block the mic on other fields. |
onReset | () => void | - | The person reset the answer, after the confirm. The text is cleared for you. |
fieldEffect | "glow" | "level" | "dots" | "none" | "glow" | How the voice is drawn inside the field, and its motion while the take is transcribed. |
glowVariant | VoiceBeamColorVariant | "mono" | The palette for the glow and every field effect. "mono" is neutral. |
buttonRadius | "auto" | "full" | number | "auto" | The mic's corners. "auto" is visually concentric with the field's. |
labels | Partial<DictationInputLabels> | - | Every string, including problems and screen-reader announcements. |
VoiceTranscriptionError
Throw it from onTranscribe to show the right message under the field.
| Prop | Type | Default | Description |
|---|---|---|---|
code | "empty" | "unconfigured" | "failed" | - | "empty": nothing was said. "unconfigured": no transcription key on the server. "failed": anything else; the take is kept and "Try again" resends it. |
Credit
The glow is Voice Glow by Jakub Antalik, used through the voice-glow package under the MIT License. Copyright © 2026 Jakub Antalik.