Component packs › Ferro › Snap Slider
Steel pins lean toward the magnet thumb as it passes; near a stop it is pulled in and lands with a clack, free in between.
Snap Slider is a slider from Ferro, a component pack with 7 components: Components that behave like magnets. Price: $5 for the whole pack.
Built with: magnetic detents, leaning pins, role slider.
Code: React and Next.js (TypeScript), Vue 3, plain HTML/CSS/JS, Tailwind CSS v4 and Motion (motion.dev). No npm packages needed. Keyboard accessible, with a reduced-motion version, in dark and light.
| Prop | Type | Default | Description |
|---|---|---|---|
min | number | 0 | Lowest value. Default 0. |
max | number | 100 | Highest value. Default 100. |
stops | number[] | every quarter | Magnetic stops. Default every quarter. |
value | number | Starting value. | |
label | string | Label above the slider. | |
format | (v: number) => string | Formats the readout. | |
onChange | (v: number) => void | Called while the value changes. | |
autoplay | boolean | Showcase mode: a ghost hand drags it until touched. |
readonly value: numberset(v: number): voiddestroy(): voidimport SnapSlider from './SnapSlider';
<SnapSlider />The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.
Good for: Micro-interactions.