Daylight

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/radio-daylight

About this component

A time-of-day picker with a little sky. The sun rides an arc from sunrise to sunset to the option you choose while the sky brightens or dims; at night a shadow slides over it to make a crescent moon and the stars come out. Pure CSS (offset-path for the arc).

Triggers

  • Click
  • State change
  • Glow

Techniques

  • CSS variables
  • CSS transition
  • Pseudo elements

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
DeliveryGet code
DialGet code
DieGet code
DrumGet code