Gradient Track

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/toggle-gradient-track

About this component

When active, the track background runs a drifting dark-to-light gray gradient on a loop, making the track itself feel alive. The thumb glows on active state. No dependencies.

Triggers

  • Click
  • State change
  • Continuous

Techniques

  • Gradient
  • Keyframes

Difficulty

Intermediate

Moves on

Its code uses this curve. Open one to see it plotted and tune it.

Accessibility

Keyboard and screen readers

role="switch" and aria-checked wired.

Reduced motion

Gradient animation replaced with solid colour under prefers-reduced-motion.

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

More toggles

See all
LiquidGet code
PowerGet code