Fan

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/radio-fan

About this component

Pick a card. Four playing cards are fanned out in a hand; hovering one nudges it up, and choosing it lifts it clear of the fan, straightens it and turns it face-lit while the rest stay tucked in. Pure CSS.

Triggers

  • Click
  • Hover
  • State change
  • Card

Techniques

  • CSS variables
  • CSS transition
  • Transform only

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. Each radio is labelled with the card, for example "Ace of spades".

Reduced motion

The changes are instant.

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

More radios

See all
Flip CardGet code
FoldersGet code
LayoutGet code
MoodGet code