Faucet

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/toggle-faucet

About this component

A tap. Switching on lifts the lever and water pours from the spout, the stream running down into rippling rings on the basin; off drops the lever and the last of the stream falls away from the spout. Pure CSS on a native switch.

Triggers

  • Click
  • State change
  • Loop

Techniques

  • Keyframes
  • CSS transition
  • Gradient

Difficulty

Intermediate

Moves on

Its code uses these curves. Open one to see it plotted and tune it.

Accessibility

Keyboard and screen readers

Native checkbox with role="switch" inside a <label>. The visible label text names it. Focus ring on the visual via :focus-visible.

Reduced motion

The change is instant.

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

More toggles

See all
Split FlapGet code
Neon SignGet code
PadlockGet code
PixelGet code