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

Import the components from `@sdxc/ui/audio` and the theme once from `@sdxc/ui/theme.css`.

## 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 frame.** Mount the bar beside the swapped `main` frame, so navigating never restarts the music.
- **Rows play.** `TrackList.PlayButton` covers its row, so a press anywhere on it plays the track.
- **One mark.** The playing row is `aria-current="true"`; any `[data-audio-paused]` ancestor stills every `Equalizer`.
- **Queue as data.** `createPlayQueue` and friends return new queues; shuffle keeps the playing track first.
- **System controls.** `syncMediaSession` publishes the track and routes media keys back to the player.
- **Thumb-sized.** Under a coarse pointer the buttons reach the target size and the ranges grow tall.

## CSS variables

Every custom property the namespace reads or declares. 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.

| Variable | Default | What it controls |
| --- | --- | --- |
| `--ui-media-tile-radius` | `var(--ui-radius-md, 0.375rem)` | Corner of a square tile's art. |
| `--ui-player-bar-fill` | `var(--ui-neutral-fg-emphasis)` | The played part of the seek and volume ranges. |
| `--ui-player-bar-track` | `color-mix(in oklch, currentColor 22%, transparent)` | The unplayed part of a range. |
| `--ui-player-bar-mini-bg` | `a mix of the raised surface and the brand` | The phone mini player's card. |
