Toothpaste

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/slider-toothpaste

About this component

A squeeze slider on a tube of toothpaste: the thumb is the winding key, the fill is the flattened, rolled-up end of the tube behind it, the rest of the tube swells a little as the paste is pushed forward, and a striped dollop grows on the nozzle, squishing out each time you push.

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

Triggers3

  • State change
  • Morph
  • Fill

Techniques4

  • Gradient
  • Keyframes
  • CSS variables
  • Transform only

Accessibility

Keyboard and screen readers

A native range input named Squeezed with the percentage as its value text; the tube is aria-hidden.

Reduced motion

The dollop does not squish.

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

More sliders

See all
TreadGet code
VelcroGet code
WakeGet code
WeldGet code