Slosh Slider
betaA slider whose fill behaves like liquid: the knob jumps to the value while the fill springs after it, leaning as it moves.
- Forms
- 1 file
- 3 npm packages
- Accessibility notes
- Animates with motion
pnpm dlx @dowel-ui/cli add slosh-slidernpm packages installed: class-variance-authority, motion, radix-ui.
import { SloshSlider } from "@/components/ui/slosh-slider";Default
Gallery
With Value Text
Disabled
<SloshSlider>
| Prop | Type | Default |
|---|---|---|
corner0–20. Corner radius of the bar, in px. | number | 13 |
defaultValueInitial value when uncontrolled. | number | 62 |
fill | "light" | "dark" | "light" |
formatValueSpoken value ( | (value: number) => string | — |
largeStepSteps moved by Page Up / Page Down (multiplied by | number | 10 |
momentum0–100. The fill's mass: higher overshoots further and settles slower. | number | 55 |
onValueChangeCalled on every change while dragging or keying. | (value: number) => void | — |
onValueCommitCalled when an interaction ends: pointer released or key pressed. | (value: number) => void | — |
strokeA 1px inset hairline ring around the bar. | boolean | false |
tilt0–100. How far the leading edge leans per unit of fill velocity. | number | 45 |
valueControlled value. | number | — |
viscosity0–100. Damping: higher is thicker liquid — less slosh, more lag. | number | 15 |
Every prop of Radix UI’s Slider.Root, plus className.
8/9
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — passes
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — does not apply
- className merged — passes
- Visible focus — fails
- No fixed widths — passes