Fit
Markup where the component goes, CSS in your stylesheet, script before </body>. In Vue, Svelte or Angular, call initSliderFit(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-fitAbout this component
A stepped size slider on a kraft paper tag: a stitched line with five eyelets, a red ink-stamp thumb that snaps from one to the next with a spring, and size labels below where the chosen one is inked in red.
Triggers
- State change
- Spring
- Click
- Ambient
Techniques
- CSS variables
- CSS transition
- Spring
- mix-blend-mode
Difficulty
Intermediate
Accessibility
Keyboard and screen readers
A native range input named "Size" with aria-valuetext giving the size name (XS to XL), so arrow keys, Home and End work; everything drawn is aria-hidden. :focus-visible on the input outlines the stamp.
Reduced motion
The transitions and animations are switched off and the thumb simply follows the value.
Use it in anything you build, commercial and client work included. Licence