Skip to content

B. Progress and Volume

<fb-seek-bar>

Playback seek bar with mouse, drag, and keyboard controls.

html
<fb-seek-bar></fb-seek-bar>
AttributeTypeDefaultDescription
positionstringRead-only current position in whole seconds
durationstringRead-only total duration in whole seconds
progressstringRead-only progress ratio from 0 to 1

CSS Parts: track, fill, thumbCSS Custom Properties: --fb-seek-progress (0–1), --fb-seek-hover-progress (0–1 while hovering) Keyboard: Arrow keys seek by ±5 seconds; Home/End seek to the start/end

Events:

js
el.addEventListener('fb-seek', e => {
  console.log(e.detail.position); // committed position in seconds
});
el.addEventListener('fb-seeking', e => {
  console.log(e.detail.position); // tentative position during a drag
});

Styling Example:

css
fb-seek-bar::part(track) { background: #333; height: 4px; }
fb-seek-bar::part(fill) { background: #1db954; }
fb-seek-bar::part(thumb) { width: 12px; height: 12px; background: white; border-radius: 50%; }

<fb-volume-control>

Volume slider with a mute button.

html
<fb-volume-control></fb-volume-control>
AttributeTypeDefaultDescription
verticalbooleanfalseUses a vertical, bottom-to-top slider layout (observed)
no-iconbooleanfalseHides the mute button (observed)
volumestringRead-only current volume on the 0–100 linear scale
mutedbooleanRead-only reflection of the mute state

CSS Parts: mute-button, track, fill, thumbSlots: icon (default: 🔊) CSS Custom Properties: --fb-volume (0–1) Keyboard: Arrow keys change volume by ±5; Home sets 0 and End sets 100 Mouse Wheel: changes volume by ±5

Events:

js
el.addEventListener('fb-volume-change', e => {
  console.log(e.detail.volume); // 0–100
});
el.addEventListener('fb-mute-toggle', e => { /* mute toggled */ });

<fb-playback-order>

Seven-state playback-order picker with dropdown and cycling-button modes.

html
<fb-playback-order mode="button"></fb-playback-order>
AttributeTypeDefaultDescription
mode'select' | 'button''button'Display mode (observed); only the exact value select selects the dropdown
orderstringRead-only reflection of the current order name

CSS Parts: button (button mode) or select (select mode) Slots: default slot (button mode label) Orders: default, repeat-playlist, repeat-track, random, shuffle-tracks, shuffle-albums, shuffle-folders

Events:

js
el.addEventListener('fb-order-change', e => {
  console.log(e.detail.order, e.detail.name);
});