Skip to content
FelicityUI

Slider

An input where the user selects a value from within a given range.

Installation

terminal
npx felicityui add slider --platform react

Usage

example.tsx
import { Slider } from "@/components/ui/slider"

<Slider defaultValue={[33]} max={100} step={1} />

Composition

Slider
├── track
├── range
└── thumb(s)

Default

Single thumb on a ruled track with copper fill.

Range

Two values for a range slider.

Multiple thumbs

An array with more than two values.

Vertical

orientation=vertical.

Controlled

value + onValueChange.

40

Disabled

disabled prevents interaction.

RTL

Logical positioning and mirrored keys under dir=rtl.

API Reference

PropTypeDefaultDescription
valuenumber | number[]—Controlled value(s).
defaultValuenumber | number[]—Uncontrolled initial value(s).
onValueChange(value: number[]) => void—Called when value(s) change.
minnumber—Minimum value. Default 0.
maxnumber—Maximum value. Default 100.
stepnumber—Increment. Default 1.
orientation"horizontal" | "vertical"—Track orientation.
disabledboolean—Disables all thumbs.
labelReactNode—Optional visible label.
descriptionReactNode—Optional helper text.
classNamestring—Additional classes on the root.

Accessibility

WCAG 2.2 AA

  • Each thumb is role=slider with aria-valuemin/max/now.
  • Arrow keys, Home/End, PageUp/PageDown adjust value.
  • Visible focus-visible ring on thumbs.
  • RTL mirrors horizontal pointer and arrow keys.

Platform notes

React

Custom multi-thumb slider with Felicity semantic tokens. Copper range fill — not Base UI / Radix runtime.

  • Client component (pointer drag + keyboard).
  • Uses data-slot=slider|slider-control|slider-track|slider-range|slider-thumb.
  • value/defaultValue are number or number[]; onValueChange always receives number[].
  • Supports range, multiple thumbs, vertical orientation, and RTL via logical positioning.