Slider
Picks a number or a range by dragging or with arrow keys.
Staticimport { Slider } from 'umbra-ui'
Props
| Prop | Type | Default | Description |
|---|---|---|---|
size | "sm" | "md" | md | Track size. |
thumbLabels | string[] | — | Accessible name for each thumb, in order. Needed for ranges; a single thumb inside a FormField is named by its label. |
Usage notes
value and defaultValue are arrays: one number for a single thumb, two for a range. Use min, max and step to set the scale.
Accessibility
- Each thumb is a
role="slider"with its current value. Inside aFormFieldthe thumb is named by the label; otherwise passaria-label, orthumbLabelsfor ranges. - Arrow keys move by one step, Page Up and Page Down by ten, Home and End to the ends.
Import
import { Slider } from 'umbra-ui';
import 'umbra-ui/styles.css'; // once, at the root of your app