Tube

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/toggle-tube

About this component

A glass tube switch: switching on pours blue liquid in behind the cap as it slides across, the surface sloshing up against it and a few bubbles rising; off drains it back.

Triggers

  • Click
  • State change
  • Fill

Techniques

  • Keyframes
  • CSS transition
  • border-radius

Difficulty

Advanced

Accessibility

Keyboard and screen readers

A native checkbox with role="switch" inside a <label>, named by aria-label ("Hydration reminders").

Reduced motion

The transitions and loops stop and the component jumps straight to its final state.

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

More toggles

See all
AmberGet code
BokehGet code
CastGet code
ConvoyGet code