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 real button with role="switch" and aria-checked (checked = sound on), named "Sound". The icon, bars and label are aria-hidden so the state is announced once.
- Keyboard. Tab to focus, Space or Enter to mute or unmute. The focus ring uses the --ring token and the whole card is a 44px+ hit target.
- Reduced motion. With prefers-reduced-motion the waves, slash and level bars jump to their end state; the loop animations stop but the muted look stays obvious.
- Contrast. Colours come from the tokens, which keep AA contrast in light and dark and in every preset.