Component
Rotary Volume Knob
Variants
The same markup drops into a normal page as a compact CSS knob with an LED arc (no WebGL needed). Sizes and states below.
Usage
Paste the markup, include assets/css/tokens.css and assets/css/tailwind.css, then run the script from this page.
Accessibility
- Role and state. The knob is a real role="slider" with aria-valuemin, aria-valuemax, aria-valuenow and a readable aria-valuetext ("78 percent, loud"). A polite live region announces the zone when it changes (Low, Mid, Loud, Overdrive).
- Keyboard. Tab to the knob. Arrow keys move by 1, PageUp and PageDown by 10, Home and End jump to 0 and 100. With a pointer, drag round the knob or scroll over it. The focus ring uses the --ring token.
- Reduced motion. With prefers-reduced-motion the LED ring and knob jump straight to the value, the overdrive shockwave and camera shake are skipped; the percentage is always shown as a number.
- Sound. A synthesized kick drum plays on the beat, scaled by the level, only after you press the speaker button. It is muted by default and never starts by itself.