Component packs › Ferro › Snap Slider

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.

Snap Slider props

PropTypeDefaultDescription
minnumber0Lowest value. Default 0.
maxnumber100Highest value. Default 100.
stopsnumber[]every quarterMagnetic stops. Default every quarter.
valuenumberStarting value.
labelstringLabel above the slider.
format(v: number) => stringFormats the readout.
onChange(v: number) => voidCalled while the value changes.
autoplaybooleanShowcase mode: a ghost hand drags it until touched.

Methods on the ref

Use it in React

import SnapSlider from './SnapSlider';

<SnapSlider />

The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.

More in Ferro

Good for: Micro-interactions.