Theme

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/radio-theme

About this component

A theme picker inside a preview panel. Choosing Light, Dim or Dark floods the panel with the new theme as a circle spreading out from the chip you picked, over the old theme, which stays put underneath until it is covered. Pure CSS: one layer per theme, stacked by z-index.

Triggers

  • Click
  • State change

Techniques

  • clip-path
  • CSS variables
  • CSS transition

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.

Reduced motion

The changes are instant.

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

More radios

See all
Tip JarGet code
TurntableGet code