Sizes

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/radio-sizes

About this component

A size picker that shows the size. Above the S, M, L, XL pills, a T-shirt springs bigger or smaller to match the one you choose, and the chest measurement under it updates. Pure CSS with :has().

Triggers

  • Click
  • State change
  • Spring

Techniques

  • CSS variables
  • CSS transition
  • Spring

Difficulty

Beginner

Accessibility

Keyboard and screen readers

Real native radios (visually hidden: absolute, 1x1, opacity 0) inside <label>s in a role="radiogroup" with an aria-label, so arrow keys, focus and screen readers work.

Reduced motion

The changes are instant.

Use it in anything you build, commercial and client work included. Licence

More radios

See all
StarsGet code
Tab BarGet code
ThemeGet code
Tip JarGet code