Skip to Content
npm i @clxrity/react-audio

Player

"use client"; import { Player } from "@clxrity/react-audio"; export default function PlayerExample() { return ( <Player src="/drooms.wav" /> ); }

Features

  • Provides a simple audio player interface.
  • Supports play, pause, and stop functionalities.
  • Displays current playback time and duration.
  • Allows volume control and mute functionality.

Props


PropertyTypeDescriptionRequiredDefault Value
srcstringThe source URL of the audio file.✅undefined
sizenumberThe size of the player.❌undefined
colorstringThe color of the player.❌rgb(236, 106, 177)
autoplaybooleanWhether the audio should start playing automatically.❌false
loopbooleanWhether the audio should loop.❌false
showProgressbooleanWhether to show the progress bar.❌true
showVolumebooleanWhether to show the volume control.❌true
showNextPrevControlsbooleanWhether to show the next and previous controls (used within ShufflePlayer).❌false
audioRefRefObject<HTMLAudioElement | null>A ref to the audio element.❌undefined
onNext() => voidCallback function for the next button. (used within ShufflePlayer)❌undefined
onPrev() => voidCallback function for the previous button. (used within ShufflePlayer)❌undefined
Last updated on

Player