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 radiogroup of five radio buttons named 1 to 5 stars. aria-checked marks the chosen rating and the live region announces the new average.
- Keyboard. Tab enters the group on one stop, arrow keys move and select, Home and End jump to 1 and 5 stars. The focus ring uses the --ring token.
- Reduced motion. With prefers-reduced-motion the tubes refill instantly with no droplet, sloshing, bubbles or camera moves.
- No WebGL. Without WebGL the stage falls back to a glow and the radiogroup still rates and announces the average.