Skip to content
Kits

AudioRecorder

Voice recorder with realtime waveform, duration, cancel, and submit controls.

Examples

Line envelope alternative

Use the line envelope implementation throughout your project by changing the visualizer import in your installed audio-recorder.tsx. This example composes a recorder with the line alternative through useAudioRecorderContext. Install audio-visualizer-line before using it.

Composition

Anatomy

  • <AudioRecorder>
    • <AudioRecorderTrigger />
    • <AudioRecorderStatus />
    • <AudioRecorderVisualizer />
    • <AudioRecorderDuration />
    • <AudioRecorderCancel />
    • <AudioRecorderSubmit />
    </AudioRecorder>

Installation

Use this command to install the component.

Registry command
See registry manifest

Usage

Dependencies

Behavior hooksrc/registry/hooks/use-audio-recorder.tsHook
Duration formattersrc/registry/lib/format-audio-recorder-duration.tsSupport
AudioVisualizeraudio-visualizerComponentButtonbuttonPrimitiveLive statuslive-statusPrimitive

Raw code

Installed component source and support files

src/registry/sources/control-ui/audio-recorder.tsx

Knobs

Typed custom properties the recipe paints with. Set one on the root — style, a utility class, or a skin — and every slot inherits it.

--cui-audio-recorder-* · 6 knobsHow the cascade resolves
--cui-audio-recorder-foreground<color>var(--muted-foreground)
--cui-audio-recorder-recording-foreground<color>var(--foreground)
--cui-audio-recorder-recorded-foreground<color>var(--foreground)
--cui-audio-recorder-recording-ring-color<color>oklch(from var(--destructive) l c h / 0.25)
--cui-audio-recorder-error-foreground<color>var(--destructive-text)
--cui-audio-recorder-meta-foreground<color>var(--muted-foreground)