Slosh Slider, animated React component
A slider whose value has mass: the rigid handle stays under your finger while the liquid fill lags behind, leans with the speed you drag at and sloshes back and forth before it settles.
- Pro
- Inputs & Controls
- Spring
Play with it
Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.
Volume55%
Drag fast and let go.
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| label | string | "Volume" | Label above the track; also the slider's accessible name. |
| defaultValue | number | 55 | Starting value, 0 to 100. |
| accent | string | "#0071e3" | Liquid colour and focus ring. |
| onChange | (value: number) => void | — | Called with the rounded value (0 to 100) whenever it changes. |
| autoplay | boolean | false | Throws the handle to a series of values until someone touches it. |