Toothpaste
Markup where the component goes, CSS in your stylesheet, script before </body>. In Vue, Svelte or Angular, call initSliderToothpaste(el) on the mounted element instead.
Paste into Claude, ChatGPT or Cursor after filling in {{USER_STACK}}, {{USER_STYLING}} and {{USER_CONSTRAINTS}}. Neutral keeps the greys you see here; Match my project asks the model to map them onto your own colour tokens.
Install with shadcn
Needs a free account token. Get a token
npx shadcn@latest add @movin/slider-toothpasteAbout 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