Variants
Sizes and states, all built from the same markup.
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. A role="radiogroup" of role="radio" buttons with aria-checked, as in Radix and shadcn. Each label is visible text (frequency and name); a polite live region announces the new station. The 3D scene is aria-hidden decoration.
- Keyboard. One tab stop; Left/Right (and Up/Down) arrows move and select, Home/End jump. The focus ring uses the --ring token; the keyboard tunes the same radio as the mouse.
- Reduced motion. With prefers-reduced-motion there is no needle overshoot, static or rings: the needle and the radio jump to the chosen station and the selection changes.
- Contrast. Colours come from the tokens, which keep AA contrast in light and dark and in every preset.