Componentmedia0.81 KB gzipZero dependencies

VoiceMessage

Chat audio bubble with play/pause button and animated waveform bars showing audio duration.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

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

npx bigbullui add voice-message

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { VoiceMessage } from "@/components/ui/voice-message"; <VoiceMessage duration={45} playing={true} onPlayPause={handlePlayPause} />

Source code

voice-message.tsx + 1 helper

Zero 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 />
PropTypeDescription
durationnumberAudio duration in seconds.
barsnumberNumber of waveform bars (default 5).
playingbooleanWhether the audio is currently playing.
onPlayPause() => voidCallback when play/pause is toggled.