Slider
Pick a value or a range. The track thickens and the thumb grows while you drag.
InputsRadix Slider
Playground
Tweak the props, the preview and the code follow.
Props
1
<Slider defaultValue={[50]} showTooltip />Installation
npx @plumsydev/plum-ui add sliderAlso pulls in label automatically.
Usage
import { Slider } from "@/components/ui/slider"<Slider defaultValue={[50]} max={100} step={1} />Examples
Value tooltip
showTooltip floats the formatted value above the thumb while dragging.
Range
Pass two values for a range.
$20 – $80
Vertical
API Reference
Slider
Extends Radix Slider.Root.
| Prop | Type | Default |
|---|---|---|
valueControlled values, one per thumb. | number[] | — |
defaultValueUncontrolled initial values. | number[] | [min] |
onValueChangeCalled while dragging. | (value: number[]) => void | — |
min / max / stepRange and granularity. | number | 0 / 100 / 1 |
showTooltipShow the value above the thumb while dragging. | boolean | false |
formatValueFormat the tooltip value. | (value: number) => ReactNode | — |
orientationLayout direction. | "horizontal" | "vertical" | "horizontal" |