Umbra UI

Slider

Picks a number or a range by dragging or with arrow keys.

Staticimport { Slider } from 'umbra-ui'

Props

PropTypeDefaultDescription
size "sm" | "md"mdTrack 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 a FormField the thumb is named by the label; otherwise pass aria-label, or thumbLabels for 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