Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Voice Input

ProNew

A microphone button that opens into a recording pill with a live, scrolling waveform.

Installation

pnpm dlx shadcn@latest add @viewport/voice-input

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
onStart() => void

Called when recording begins.

—
onStop(seconds: number) => void

Called with the length of the recording in seconds.

—
simulateboolean

Draw a synthetic waveform instead of asking for the microphone. Also the fallback when access is denied.

false
barsnumber

Number of bars in the waveform.

28
classNamestring—

Accessibility

  • Start and stop are labelled buttons; stop reads out the time so far, and focus moves between them.
  • Recording is announced through a status region.
  • Falls back to a synthetic signal when the microphone is unavailable.