Componentmedia1.91 KB gzipZero dependencies
AudioPlayer
Full deck audio player with play/pause morph button, seek bar, time readout, volume slider, and track info
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add audio-playerOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { AudioPlayer } from "@/components/ui/audio-player" <AudioPlayer title="Track Title" artist="Artist Name" duration={180} />Source code
audio-player.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxaudio-player.tsx243 lines
"use client"; import * as React from "react";import { cn, isSafeUrl } from "./lib/utils"; export interface AudioPlayerProps extends React.HTMLAttributes<HTMLDivElement> { title: string; artist?: string; duration?: number; src?: string; cover?: React.ReactNode; className?: string;} function isSafeCoverSrc(src: string): boolean { const trimmed = src.trim(); return isSafeUrl(trimmed) || /^data:image\/(?:png|jpe?g|webp|gif|svg\+xml)[;,]/i.test(trimmed);}Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { AudioPlayer } from "@/components/ui/audio-player"; <AudioPlayer />| Prop | Type | Description |
|---|---|---|
| title | string | Primary heading or title text. |
| artist | string | Configures artist. (Default: "Unknown Artist") |
| duration | number | Configures duration. (Default: 180) |
| src | string | Configures src. |
| cover | React.ReactNode | Configures cover. |
| className | string | Optional Tailwind or custom CSS classes merged with component styles. |