Componentmedia0.81 KB gzipZero dependencies
VoiceMessage
Chat audio bubble with play/pause button and animated waveform bars showing audio duration.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add voice-messageOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { VoiceMessage } from "@/components/ui/voice-message"; <VoiceMessage duration={45} playing={true} onPlayPause={handlePlayPause} />Source code
voice-message.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxvoice-message.tsx108 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; const VoiceMessage: React.FC<{ duration: number; bars?: number; playing?: boolean; onPlayPause?: () => void;}> = ({ duration, bars = 5, playing = false, onPlayPause }) => { const renderBars = () => { if (playing) { return ( <span className={cn( "flex items-baseline gap-0.5",Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { VoiceMessage } from "@/components/ui/voice-message"; <VoiceMessage />| Prop | Type | Description |
|---|---|---|
| duration | number | Audio duration in seconds. |
| bars | number | Number of waveform bars (default 5). |
| playing | boolean | Whether the audio is currently playing. |
| onPlayPause | () => void | Callback when play/pause is toggled. |