SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

On this page

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
tsx
<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.

Terminal
npm add @sdxc/ui remix
typescript
import "@sdxc/ui/theme.css";

Usage

typescript
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.

PropTypeRequiredDescription
labelstringYesThe landmark's name, such as "Player".
trackRemixNodeYesWhat plays: a PlayerBar.Track.
controlsRemixNodeYesThe transport buttons in a row, then a PlayerBar.Seek under them.
extrasRemixNodeNoPanel toggles and the volume, at the bar's end.

Also accepts everything in Omit<TagProps<"section">, "children">.

@sdxc/ui

Can’t find it? Contact us