Pricing toggle
A billing switch changes the price and shows the annual saving, with role="switch" kept in sync.
Three steps with Back and Next buttons, a step list you can click, and aria-current on the current step.
Use Next and Back, or click a step in the list.
| name | value | previous | changes |
|---|---|---|---|
| Waiting for the preview to start. | |||
One number state drives a multi-step flow from three directions: the step list, Next and Back. Next and Back compute their value at the click, clamped with min() and max(), so the step stays between 1 and 3.
None: CSS has no counter that a button can change.
/* ---- Reactive CSS -------------------------------------------------------------------------- */.wizard { --step: state(1); }/* The list item's position is the step: the buttons are the only child of each li. */.wizard li:on(click) { --step: set(sibling-index()); }.wizard .next:on(click) { --step: set(min(var(--step) + 1, 3)); }.wizard .back:on(click) { --step: set(max(var(--step) - 1, 1)); }.wizard .panel:nth-var(--step) { display: block; }.wizard li:nth-var(--step) .step { background: var(--ink); color: #fff; --attr-aria-current: step; }/* No Back on the first step, no Next on the last: disabled, so they leave the Tab order too. */.wizard:when(--step == 1) .back { --attr-disabled: true; }.wizard:when(--step == 3) .next { --attr-disabled: true; }Source: site/src/catalog/interfaces/step-wizard/. style.css from its Reactive CSS divider; the layout above it and the shared api.css run but are not shown.
A billing switch changes the price and shows the annual saving, with role="switch" kept in sync.
Tabs selected by click or arrow keys, with the ARIA tab pattern written from one state.
Each item opens and closes on its own, and its button reports the state with aria-expanded.