Patina

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/toggle-patina

About this component

A doorbell switch on a strip of tarnished brass: the path the thumb runs along is rubbed bright, and it wears a little brighter every time you switch, with a gleam running along it behind the thumb.

Dependencies
None
Difficulty
Intermediate
Reduced motion
Respected
Theme
Light and dark
Follows page color-scheme

Triggers3

  • Click
  • State change
  • Gradient

Techniques3

  • CSS variables
  • Keyframes
  • Gradient

Accessibility

Keyboard and screen readers

A native checkbox with role="switch" inside a <label>, so Space toggles it and the visible text names it; :focus-visible on the input outlines the track, which is aria-hidden.

Reduced motion

The gleam does not run.

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

More toggles

See all
PegboardGet code
PinchGet code
PistonGet code
PolariserGet code