Candles

Candle
No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/radio-candles

About this component

Three pillar candles of different heights. Picking one lights it: the flame springs up and flickers, the top of the wax glows through, and the candle that was lit goes out.

Triggers

  • Click
  • State change
  • Glow
  • Loop

Techniques

  • Keyframes
  • Radial gradient
  • border-radius
  • CSS variables
  • Pseudo elements

Difficulty

Intermediate

Accessibility

Keyboard and screen readers

Native radios in a fieldset with a visually hidden legend ("Candle"), each in a <label> and named by aria-label (Coral, Teal, Mustard); the candles are aria-hidden. :focus-visible outlines the candle.

Reduced motion

The flicker is switched off and the flame is shown still.

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

More radios

See all
Rating
ChalkGet code
Plan
ChoiceGet code
Honey
CombGet code
Answer
ComicGet code