Control panels · component · 7K

Sound panel

A Sound control panel: a vertical speaker-volume slider with ticks 0–7, the alert voices in a scrolling list that previews on select, and a "Play alert sounds" switch (off until the user turns it on).

Uncontrolled it reads and saves the shared settings of the sound item, so useBeep() anywhere on the page follows it; pass value/onValueChange to keep the settings yourself. Previews fire the "s7ui:beep" event too, so with sound off or at volume 0 a useBeepFlash() flash still shows. Voice names are overridable through labels.voiceNames.

Install

pnpm dlx shadcn@latest add @s7ui/sound-panel

Example

This example also uses @s7ui/button @s7ui/sound @s7ui/window.

Menu bar

Speaker Volume

Alert Sounds

Chirp
Clonk
Ping
Wood
Zap
Drip

Sound is off: alerts are visual only.

Sound starts off. Turn on “Play alert sounds” to hear the voices; with sound off or at volume 0 the bar above still flashes.

Info

Files:
components/retro/sound-panel.tsx
Uses:
@s7ui/theme, @s7ui/sound, @s7ui/control-panel, @s7ui/bitmap, @s7ui/checkbox, @s7ui/label, @s7ui/list-box, @s7ui/slider
Packages:
—