Squish
Markup where the component goes, CSS in your stylesheet, script before </body>. In Vue, Svelte or Angular, call initToggleSquish(el) on the mounted element instead.
HTML
CSS
JavaScript
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/toggle-squishAbout this component
The thumb stretches horizontally as it slides, peaking at 1.5× width mid-travel before snapping back to a circle at the destination.
Triggers
- Click
- State change
Techniques
- Keyframes
- Transform only
Difficulty
Intermediate
Accessibility
Reduced motion
Keyframe animation disabled under prefers-reduced-motion; thumb jumps directly.
Use it in anything you build, commercial and client work included. Licence