Slider

Range selector with single or dual thumbs, step snapping, marks, and keyboard arrow support.

Forms & Inputs@sisyphos-ui/sliderView on npmView as Markdown

Preview

tsx

Value: 40

Playground

Flip props to see how the component responds. The snippet below updates as you change options.

Value: 50

Installation

Install the individual package:

$ pnpm add @sisyphos-ui/slider @sisyphos-ui/core

Or use the umbrella package that bundles everything:

$ pnpm add @sisyphos-ui/ui

Usage

Import the component styles and the component itself:

snippet.tsxtsx
import "@sisyphos-ui/slider/styles.css";
import { Slider } from "@sisyphos-ui/slider";

Range

Pass two thumbs by adding `range` and a tuple value.

tsx

Range: 2080

Show value labels

Render live value bubbles above the thumbs via `showValue`.

tsx
60

Formatted values

`formatValue` lets you add currency, units, or locale formatting.

tsx
$120$480

Disabled

Works for both single and range modes.

tsx

Semantic colors

Reuse the 5-color palette shared across the library.

tsx

API

Props table is being written. See the package README for the complete API surface.

The full API including refs, ARIA attributes, and HTML passthroughs lives in the package README.

Was this page helpful?
Edit this page on GitHub