Shape

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/radio-shape

About this component

A shape picker whose preview morphs: circle, square, triangle and star are all 20-point polygons drawn from the top clockwise, so choosing one melts the preview straight into the next with a springy overshoot. Pure CSS (clip-path interpolation).

Triggers

  • Click
  • State change
  • Morph
  • Spring

Techniques

  • clip-path
  • CSS transition
  • Spring

Difficulty

Intermediate

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. Each radio is labelled with its shape; the icons are aria-hidden.

Reduced motion

The changes are instant.

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

More radios

See all
SizesGet code
StarsGet code
Tab BarGet code
ThemeGet code