Tide

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/toggle-tide

About this component

A dark mode switch whose track is a window onto the sea: a peach sunset with clouds and a small boat; switching to night slides the dark thumb across, sinks the sun into the sea, raises the moon on the other side with its path of light and brings out the stars.

Triggers

  • Click
  • State change
  • Ambient
  • Loop

Techniques

  • SVG
  • Keyframes
  • CSS transition
  • Transform only

Difficulty

Advanced

Accessibility

Keyboard and screen readers

A native checkbox with role="switch" inside a <label>, named by aria-label ("Dark mode"); the scene and thumb are aria-hidden, and :focus-visible on the input outlines the frame.

Reduced motion

The scene swaps without moving and the ambient loops stop.

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

More toggles

See all
TileGet code
TubeGet code
AmberGet code
BokehGet code