Recorder
A tactile recorder with an animated pixel grid.
Installation
npx shadcn@latest add qubydev/bunui/recorderHow to use
import { Recorder } from "@/components/ui/recorder"export function Demo() {return (<RecorderonStop={(duration) => {console.log("Recording finished:", duration)}}/>)}
Props
Options you can pass to customize this component.
state"idle""recording""done"Controlled state of the recorder.
defaultState"idle""recording""done"Initial uncontrolled state.
onStateChange(state: RecorderState) => voidCallback fired when the recorder state changes.
onStart() => voidCallback fired when recording starts.
onStop(duration: number) => voidCallback fired when recording is marked as done with duration in seconds.
onCancel() => voidCallback fired when recording is cancelled.
onReset() => voidCallback fired when reset back to idle.
onPlay() => voidCallback fired when playback starts in done state.
onPause() => voidCallback fired when playback is paused in done state.
iconReact.ReactNodeCustom icon for the record button in idle state. Defaults to CircleDot.
recordingLabelstringText label displayed beside the timer in recording state.
sizesmdefaultlgVisual scale variant of the recorder.
maxDurationnumberMaximum recording duration in seconds before auto-stopping.
disabledbooleanWhether interaction is disabled.
classNamestringExtra classes merged onto the recorder container element.
Dependencies
License & Usage
- •Free to use and modify in personal and commercial projects.
- •Attribution to Bun UI is appreciated when using a component.
- •Please do not resell the components as your own kit.