Skip to content
synccn

Audio Player

New

Voice-note player with a seekable waveform.

Voice note from Riley

0:38
1:14

Silent preview. Pass a src to play a real file.

Installation

$ pnpm dlx shadcn@latest add @synccn/audio-player

First time in this project? Connect synccn with one command.

Usage

import { AudioPlayer } from "@/components/ui/audio-player";<AudioPlayer src="/note.mp3" />

API reference

Generated from the component's TypeScript types, so it always matches the code.

AudioPlayer

Voice-note style player with a clickable waveform. Pass `src` for a real audio file; without one it runs a silent preview for `duration` seconds.

  • src
    string

    Audio file URL. Without it the player runs a silent preview.

  • duration
    number

    Default 42

    Length in seconds for the silent preview (read from the file when src is set).

  • bars
    number

    Default 48

    Number of waveform bars.

  • title
    React.ReactNode

    Label above the waveform.

  • className
    string

    Extra classes for the root element.

Dependencies

Read from the component's imports when the site builds. The CLI installs all of these for you.

Helpers

npm packages

Accessibility

From the source

Read from this component's code when the site builds, so it can't drift.

  • ARIA roles: slider
  • ARIA attributes: aria-label, aria-valuemax, aria-valuemin, aria-valuenow
  • Keys handled: ArrowLeft, ArrowRight
  • Shows a visible focus ring for keyboard users