SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

Audio foundations

What @sdxc/ui/audio is for, the rules its parts share, and every variable it reads.

The parts of a music app: a track table, artwork tiles, a player bar with its phone mini player, a queue and the playing mark.

They draw; a player drives them with the play queue and Media Session helpers the namespace ships beside them.

typescript
import "@sdxc/ui/theme.css";
import { … } from "@sdxc/ui/audio";

When to reach for it

  • An album, playlist or artist page whose tracks play from a table.
  • A player bar that stays mounted while the rest of the app swaps beneath it.
  • Lock-screen and media-key controls for any page that plays audio.

Shared ideas

  • Outside the frameMount the bar beside the swapped main frame, so navigating never restarts the music.
  • Rows playTrackList.PlayButton covers its row, so a press anywhere on it plays the track.
  • One markThe playing row is aria-current="true"; any [data-audio-paused] ancestor stills every Equalizer.
  • Queue as datacreatePlayQueue and friends return new queues; shuffle keeps the playing track first.
  • System controlssyncMediaSession publishes the track and routes media keys back to the player.
  • Thumb-sizedUnder a coarse pointer the buttons reach the target size and the ranges grow tall.

CSS variables

Every custom property the namespace reads or declares, with its default and what it controls.

Reads the neutral role for text, hairlines and washes, and brand for the playing row, toggles that are on and a slider under the pointer. The roles are documented on Theming.

Shape and fill

None is declared in theme.css; set any of them on a part or an ancestor.

VariableDefaultWhat it controls
--ui-media-tile-radiusvar(--ui-radius-md, 0.375rem)Corner of a square tile's art.
--ui-player-bar-fillvar(--ui-neutral-fg-emphasis)The played part of the seek and volume ranges.
--ui-player-bar-trackcolor-mix(in oklch, currentColor 22%, transparent)The unplayed part of a range.
--ui-player-bar-mini-bga mix of the raised surface and the brandThe phone mini player's card.
@sdxc/ui

Can’t find it? Contact us