A three-way segmented control whose raised thumb slides to the chosen option with a soft squash on arrival, while the labels cross from grey to black under it. It is a radio group underneath, so arrow keys and form submission work without script.
Thumb `translateX(calc(index × 100%))` chosen by `:has(label:nth-child(n) input:checked)`, 0.3 s `cubic-bezier(.2,.8,.2,1)`; on change the script adds `.squash` for 0.3 s which runs `scaleX(1.08) → 1` so the thumb lands with a little give. Labels transition colour 0.2 s; the selected one is bold.
From prompt to a block in your page.
The preview is the shipped element inside a neutral demo page. Hover, click, focus: the one interaction it is about is live.
Token sets re-tint it live. The prompt carries the one you chose.
A paste-in snippet, or a component for Next.js, React, Vue, Astro, WordPress, Shopify or Webflow.
It quotes the markup, styles and script verbatim with the tokens and the rules that keep it self-contained.
It inherits your page's font and width; the tokens live on :root; several instances share one script.