KQ-755 · VOICE/PROMPT
Voice Prompt
Speak; the words appear. A hold-to-talk button with two rings behind it: the inner follows the level on flick, the fastest house spring, so it reads as the voice rather than lagging it, and the outer trails the same level on glide so a loud moment leaves a wake. Pointer down or a held Space or Enter begins the hold, the pointer is captured only after four pixels of travel so a click stays a click, interim words arrive from four pixels on snap in light ink and firm to full ink when final, and release fires onSend with the joined words as a Sent stamp lands on recoil. No microphone is read; the level and the words come from the parent.
Hold the button and speak
Hold to talkHold to talk
Install
One command — the source lands in your repo. Or copy it from the Code tab.
$ pnpm dlx shadcn@latest add @kinetiq/voice-prompt
Props
- level
- number
- default 0
- Voice level 0..1; drives the rings while holding.
- words
- VoiceWord[]
- default []
- { id, text, final } — interim words read light, final words firm to full ink.
- holding
- boolean
- default —
- Optional controlled hold state; the component holds its own when omitted.
- onHoldStart
- () => void
- default —
- Fires from the press that begins a hold; start listening here.
- onSend
- (text: string) => void
- default —
- Fires from the release with the joined words.
- onCancel
- () => void
- default —
- Fires from Escape during a hold, a lost focus, or a release with nothing said.
- label
- string
- default "Hold to talk"
- The button's accessible name.
| Prop | Type | Default | Description |
|---|---|---|---|
| level | number | 0 | Voice level 0..1; drives the rings while holding. |
| words | VoiceWord[] | [] | { id, text, final } — interim words read light, final words firm to full ink. |
| holding | boolean | — | Optional controlled hold state; the component holds its own when omitted. |
| onHoldStart | () => void | — | Fires from the press that begins a hold; start listening here. |
| onSend | (text: string) => void | — | Fires from the release with the joined words. |
| onCancel | () => void | — | Fires from Escape during a hold, a lost focus, or a release with nothing said. |
| label | string | "Hold to talk" | The button's accessible name. |