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 products plus a disclosure button with aria-expanded controlling the stage. The live region announces the product and whether the box is open.
- Keyboard. Tab reaches the group, arrow keys move and select a product, Enter or Space on the button opens and closes the box. Focus rings are always visible.
- Pointer and touch. Hit targets are at least 44px. Click the 3D box to toggle it, drag to spin the product. Nothing depends on dragging.
- Reduced motion. With reduced motion the box jumps straight to its open or closed state, no flaps swing, no sparks, no beam pulse. The state is still obvious.