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 role="dialog" with aria-modal, aria-labelledby and a focus trap. The floor indicator uses aria-current="step", plans are a radiogroup, extras are checkboxes, and the error is a role="alert" message with aria-invalid.
- Keyboard. Tab loops inside the dialog, Enter in a field goes to the next floor, arrow keys move between plans, Esc closes and focus returns to Book a floor. The live region announces each floor.
- Pointer and touch. Buttons are 40px tall or more, the lift is decoration so nothing depends on pointing at it. Vertical page scroll still works over the stage.
- Reduced motion. With reduced motion the cabin jumps to its floor, doors snap open and no sparks, shake or confetti play. Steps, validation and announcements are unchanged.