Componentmedia1.13 KB gzipZero dependencies

Audio Recorder

Microphone recording simulator with waveform and send action.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add audio-recorder

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { AudioRecorder } from "@/components/ui/audio-recorder"; <AudioRecorder />

Source code

audio-recorder.tsx + 1 helper

Zero third-party dependencies (2 local files shown in tabs below).

tsxaudio-recorder.tsx72 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface AudioRecorderProps extends React.HTMLAttributes<HTMLDivElement> {  onSend?: (seconds: number) => void;} /** Audio recorder simulator: waveform + duration + send. */export function AudioRecorder({ onSend, className, ...props }: AudioRecorderProps) {  const [recording, setRecording] = React.useState(false);  const [seconds, setSeconds] = React.useState(0);   React.useEffect(() => {    if (!recording) return;    const t = setInterval(() => setSeconds((s) => s + 1), 1000);    return () => clearInterval(t);

Props

PropTypeDescription
onSend(seconds: number) => voidCallback invoked on send.