Skip to content
Alea0.1

Forms

Slider

Pick a value or a range by dragging, with the value shown and formatted.

Ant Design: Slider

import { Slider } from '@alea/ui';

Examples

Slider

One value, shown and formatted.

1.25
80%

Range

An array value gives two thumbs; name each one.

$19 to $79

Props

Slider props

Pick a value, or a range when value is an array (two thumbs). Arrows, Page Up/Down, Home and End work.

PropTypeDefaultDescription
labelReactNode-The visible label.
showValuebooleantrueShow the current value next to the label. Default true.
thumbLabelsstring[]-Labels for each thumb in a range ("Minimum", "Maximum").

Accessibility

  • Each thumb is a slider with its own label in a range.

Keyboard

KeyDoes
Arrow keysStep
Page Up / DownBigger steps
Home / EndMin / max

Do and don't

Do

  • Show the value.
  • Use formatOptions for units.

Don't

  • Don't use when an exact number matters: add a NumberField.
Tested with axe, keyboard and screen reader roles