Slider
A candy-filled slider. The heart thumb stretches into a teardrop the faster you drag, like pulled mochi, and sheds hearts behind it. Let go and it snaps back with a ぴたっ.
Moe level64%
Installation
❯ npx shadcn@latest add https://yan.moe/r/slider.jsonUsage
import { Slider } from "@/components/ui/slider"<Slider defaultValue={[64]} max={100} step={1} aria-label="Moe level" />Pass two values for a range:
<Slider defaultValue={[20, 80]} />Accessibility
- Built on Radix Slider: arrow keys, Page Up/Down, Home and End all work, and each thumb is a
role="slider". - Give it an
aria-labeloraria-labelledby. - The stretch and the trail follow drag speed, and are skipped entirely with
prefers-reduced-motion: reduce.
API
| Prop | Type | Default |
|---|---|---|
intensitykawaii: speed stretch, heart trail and a ぴたっ on release. subtle: a light stretch and sparkles. off: neither. | "kawaii" | "subtle" | "off" | "kawaii" |
fxOverrides for the burst fired when a drag ends. | BurstOptions | - |
value / defaultValueOne entry per thumb. | number[] | - |
min / max / stepRange and increment. | number | 0 / 100 / 1 |
onValueChange / onValueCommitWhile dragging, and when the drag ends. | (value: number[]) => void | - |