PlayerBar
A music player's controls as one bar along the window's foot.
Last Train BloomNeon Orchard
1:374:02
Last Train BloomNeon Orchard
View code
<PlayerBar
label="Player"
track={<PlayerBar.Track art={cover} title="Last Train Bloom" subtitle="Neon Orchard" />}
controls={
<>
<div>
<PlayerBar.Button label="Disable shuffle" pressed><ShuffleIcon /></PlayerBar.Button>
<PlayerBar.Button label="Previous"><SkipBackIcon /></PlayerBar.Button>
<PlayerBar.Button label="Pause" primary><PauseIcon /></PlayerBar.Button>
<PlayerBar.Button label="Next"><SkipForwardIcon /></PlayerBar.Button>
<PlayerBar.Button label="Enable repeat"><RepeatIcon /></PlayerBar.Button>
</div>
<PlayerBar.Seek aria-label="Seek" current={97} duration={242} />
</>
}
extras={<PlayerBar.Range aria-label="Volume" value={70} />}
/>Installation
An ordinary dependency: install it, import the theme once, and import the component where it is used.
npm add @sdxc/ui remiximport "@sdxc/ui/theme.css";Usage
import { PlayerBar } from "@sdxc/ui/audio";Renders the bar: three columns from a laptop's width, and on a narrower container the track and the transport alone, with the seek bar across the top edge.
Props
Read from the component's own types, so every prop, every default and every allowed value is listed.
| Prop | Type | Required | Description |
|---|---|---|---|
label | string | Yes | The landmark's name, such as "Player". |
track | RemixNode | Yes | What plays: a PlayerBar.Track. |
controls | RemixNode | Yes | The transport buttons in a row, then a PlayerBar.Seek under them. |
extras | RemixNode | No | Panel toggles and the volume, at the bar's end. |
Also accepts everything in Omit<TagProps<"section">, "children">.