Sliderv0.4.4Ready for Production
An interactive slider component for selecting values within a range, featuring single value selection, range selection, and optional segment markers.
Prefer AI-assisted development?
Catalyst Slider extends Radix UI's Slider primitive with built-in CVA variants, design-token styling, and dark-mode support — giving you a fully accessible, production-ready range input with support for single values, dual-thumb ranges, and optional segment markers.
Installation
npm install @pmi/catalyst-sliderimport { SliderRoot, SliderTrack, SliderRange, SliderThumb, SliderSegment } from '@pmi/catalyst-slider';Common Patterns
Range
Select a range of values using two thumbs.
With Segments
Display visual tick markers at each step position along the track.
Range with Segments
Combine dual-thumb range selection with segment markers.
Disabled State
Slider with Label
Slider Range with Label
Slider with Output
Slider Range with Output
Slider with Reference Labels
Slider with Range Labels
API Reference
Slider is a compound component built on Radix UI Slider. The sections below summarize the Catalyst-specific API surface for each part.
SliderRoot
The root container that manages slider state and orientation. Accepts all standard Radix Slider Root props and forwards ref.
Prop
Type
SliderTrack
The track element that contains the filled range. Accepts all standard Radix Slider Track props and forwards ref.
Prop
Type
SliderRange
The filled portion of the track representing the selected value or range. Accepts all standard Radix Slider Range props and forwards ref.
Prop
Type
SliderThumb
The draggable handle for selecting values. Render one thumb for a single value, two for a range. Accepts all standard Radix Slider Thumb props and forwards ref.
Prop
Type
SliderSegment
An optional visual tick marker positioned along the track at a given percentage. Not a Radix primitive — this is a Catalyst-only addition.
Prop
Type
Accessibility
Slider is designed to meet WCAG 2.2 AA standards.
Keyboard Interactions
| Key | Action |
|---|---|
Arrow Right / Arrow Up | Increase value by one step |
Arrow Left / Arrow Down | Decrease value by one step |
Page Up | Increase value by a larger step |
Page Down | Decrease value by a larger step |
Home | Jump to minimum value |
End | Jump to maximum value |
Tab | Move focus between thumbs (range mode) |
ARIA
- Radix renders
role="slider"on each thumb and keepsaria-valuenow,aria-valuemin, andaria-valuemaxin sync automatically. aria-disabledis set whendisabledistrue.- Always provide an accessible name on every
SliderThumb(WCAG 2.2 SC 4.1.2). Two approaches are supported:aria-label— use when there is no visible label:<SliderThumb aria-label="Volume" />aria-labelledby— use when a visible label element is present: assignidto the label and reference it on the thumb:<SliderThumb aria-labelledby={labelId} />. For range sliders with two thumbs, combine the group label id with a per-thumb id:aria-labelledby={"${labelId} ${thumbId}"}".
See the Radix Slider accessibility docs for the full baseline behavior.
Choosing the Right Component
Use Slider when users need to select a numeric value or range by dragging. Reach for a different primitive when:
| If you need… | Use instead |
|---|---|
| A binary on/off toggle | Switch |
| A single selection from a discrete set | Radio Group |
| Precise numeric input the user types | Text Field |
| Multiple independent on/off options | Checkbox |
Related
Select
A dropdown component for selecting options from a list, built on Radix UI Select with Catalyst design tokens and CVA size variants. Supports Single Select (one option) and Multi-Select (multiple options via checkboxes and tags) patterns.
Switch
A toggle control that allows users to switch between on and off states.