Voice halo Pro
One payment, every Pro piece. $10 tomorrow.
Install
npx shadcn@latest add @mu-pro/voice-haloPro. Installs with your licence key through the @mu-pro registry; the key comes with Pro. Lands in components/mu/voice-halo/ with the shared foundation.
Usage
import { VoiceHalo, webSpeech } from "@/components/mu/voice-halo/VoiceHalo";
<VoiceHalo transcribe={webSpeech()} onTranscript={(text) => setNote(text)} />
// in a composer, beside your field
<VoiceHalo size="md" transcribe={yourTranscriber} onTranscript={setDraft} />Use with an agent Beta
npx shadcn@latest add @mu-pro/uisdk/voice-haloOptional. An AI agent in your app can read and set this piece by name, and you can ask before anything it can’t undo. The piece itself doesn’t change; installs with your Pro key, like the piece. Built on UI SDK 0.1.0-beta.23, which is in beta too, so this add-on follows its releases.
Source
How it works
Building with an agent? Hand it a ready prompt for this piece.
Input and reduced motion
- Pointer / touch: press the key to start, press again to stop. While it asks for the microphone or transcribes, the key stays focusable but ignores presses. The composer key's touch target is 44px.
- Keyboard: Tab to the key; Enter or Space starts and stops. A live region says each state ("Listening", "Transcribing", "Saved · 00:07", or why the microphone can't be used).
- Reduced motion: the ring opens and closes at once, its loud side stays at the top, and the transcribing sweep is left out; the ticks still follow the voice, the words appear without rising, and the saved tick is drawn.
Props
| Prop | Default | What it does |
|---|---|---|
size | "lg" | "xl", "lg", "md" | lg: the 80px key with its full ring, a status line and the words under it. xl: the same hero at 1.4× (a 112px key), for a showcase. md: a 36px key with a compact ring for a composer; its status is spoken, not shown, and the words go to your field through onTranscript. |
transcribe | — | function | Turns a take into words. It gets { stream, say, signal }: the microphone's MediaStream, say(text, final) for the words so far, and an AbortSignal that aborts when the person stops. Return (or resolve) the final text, nothing, or false; throw or reject for the failed state. While its promise runs after the stop, the ring shows "Transcribing". |
webSpeech(lang?) | — | export | A built-in transcribe from the browser's own speech recognition, where there is one. Some browsers send the audio to their maker's service to do it. |
onTranscript | — | (text, final) => void | The whole text so far each time, final once those words are settled. |
onAudio | — | (stream) => void | The microphone's stream as a take goes live, to record or upload it yourself. |
listening | — | boolean | Controlled: true starts a take, false stops it, silently. |
onListeningChange | — | (listening) => void | true as a take goes live, false as it stops; never as an echo of listening. |
onPhase | — | (phase) => void | Every phase it moves to (see data-state). |
level | — | () => number, 0–1 | Your own input level instead of the microphone, read each frame (from your own AnalyserNode, say); the item then opens no microphone, and stream is undefined. |
labels | English | object | dictate, stop, idle, asking, listening, transcribing, saved (a template: "Saved · {time}", mm:ss), failed, denied, missing, busy, insecure, micFailed. |
sound | off | true or 0–1 | Start, stop and result sounds (see Sound). |
className | — | — | added to the root |
Sound
None. It loads in silence.
Off unless you pass sound (true, or a volume 0–1). A press that starts a take plays mic-open; a press that stops it plays key, then saved or failed when the words come back. Nothing plays on hover, on mount, from listening, or when a transcriber ends a take by itself. setMuted(true) from components/mu/sounds.ts silences every cottoncandy item at once.
Licence
Included with Pro: use it in unlimited end products for you and your clients; no reselling as a kit. See the licence.
A mic key whose ring of light listens: ticks round it lengthen where your voice is loud, and the words you say arrive under it.
For voice assistants and live dictationMore in AI & agents