Form controls

Slider
v0.4.4
Ready 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?

This documentation is available via the Catalyst MCP Server. Learn how to connect →

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.

Preview

Installation

npm install @pmi/catalyst-slider
import { SliderRoot, SliderTrack, SliderRange, SliderThumb, SliderSegment } from '@pmi/catalyst-slider';

Common Patterns

Range

Select a range of values using two thumbs.

Preview

With Segments

Display visual tick markers at each step position along the track.

Preview

Range with Segments

Combine dual-thumb range selection with segment markers.

Preview

Disabled State

Preview

Slider with Label

Preview
Slider with label

Slider Range with Label

Preview
Slider Range with labelMinimum valueMaximum value

Slider with Output

Preview
Slider with output50

Slider Range with Output

Preview
Slider Range with output25–75
Minimum valueMaximum value

Slider with Reference Labels

Preview
Slider with reference labels

Slider with Range Labels

Preview
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

KeyAction
Arrow Right / Arrow UpIncrease value by one step
Arrow Left / Arrow DownDecrease value by one step
Page UpIncrease value by a larger step
Page DownDecrease value by a larger step
HomeJump to minimum value
EndJump to maximum value
TabMove focus between thumbs (range mode)

ARIA

  • Radix renders role="slider" on each thumb and keeps aria-valuenow, aria-valuemin, and aria-valuemax in sync automatically.
  • aria-disabled is set when disabled is true.
  • 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: assign id to 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 toggleSwitch
A single selection from a discrete setRadio Group
Precise numeric input the user typesText Field
Multiple independent on/off optionsCheckbox

On this page