Audio Player
An audio playback component in Compact and Detailed layouts, with Transparent, Brand, Black, and Neutral colour styles.
'use client'; import { AudioPlayer } from 'sdaia-ui';import { useEffect, useState } from 'react'; Installation
npx sdaia-ui@latest add audio-player
Usage
import { AudioPlayer } from "@/components/ui/audio-player"<AudioPlayer type="compact" style="neutral" />Examples
Compact
Compact audio player for minimal interfaces.
<AudioPlayer type="compact" style="neutral" currentTime="0:12" duration="2:32"Detailed
Detailed audio player with full playback controls and track information.
<AudioPlayer type="detailed" style="neutral" audioName="Episode 3: The Future of Design Systems" currentTime="0:12"API Reference
AudioPlayerProps
Props for the AudioPlayer component.
Prop | Type | Default | Required |
|---|---|---|---|
type | 'compact' | 'detailed' | 'compact' | optional |
style | 'transparent' | 'neutral' | 'brand' | 'transparent' | optional |
playing | boolean | - | optional |
defaultPlaying | boolean | false | optional |
progress | number | - | optional |
defaultProgress | number | 0 | optional |
currentTime | string | '0:00' | optional |
duration | string | '0:00' | optional |
audioName | string | - | optional |
onPlay | () => void | - | optional |
onPause | () => void | - | optional |
onSkipBack | () => void | - | optional |
onSkipForward | () => void | - | optional |
onProgressChange | (value: number) => void | - | optional |
onVolumeClick | () => void | - | optional |
onSettingsClick | () => void | - | optional |