Skip to content
Playground

Slider

A single or multi-thumb numeric range control.

Use Slider to adjust a numeric value or select a range. Compose a label, value output, control, track, indicator, and one thumb per selected value.

Backed by Base UI Slider for upstream behavior and configuration. Zenos owns the public API, styling, and composition shown on this page.

Volume
40
TSX
import { Slider } from "@zentara-co/zenos-ui";

Pass an array with one value per thumb to select a range. Give each thumb a distinct accessible label, and use minStepsBetweenValues when the values must keep a minimum distance.

Risk score range
20–80

Hovering a thumb reveals a subtle halo at 20% opacity. Pressing or dragging uses a stronger layer at 30% opacity around the active thumb, while keyboard focus retains a distinct focus ring. The halo sits outside the thumb so its border remains intact; it does not change the thumb’s position or track dimensions. Disabled thumbs do not show interaction layers, and reduced-motion preferences disable their transitions.

Each Slider.Thumb shows its current value in a tooltip while it is being dragged or adjusted with the keyboard. Range sliders show the value for each active thumb independently. Set showTooltip={false} on a thumb when the value is already communicated clearly beside the control or when a custom presentation replaces it.

onValueChange runs continuously during interaction. Use onValueCommitted for work that should happen after a pointer or keyboard change finishes, such as persisting settings or requesting filtered data.

Alert threshold
35%

Committed threshold: 35%

Set orientation="vertical" on the root. The track stays narrow and centered, and the indicator grows upward from the minimum value at the bottom. Vertical sliders use the same parts and value model as horizontal sliders.

Slider.Control defaults to 160px tall. Change its length with an orientation-specific class such as data-[orientation=vertical]:h-48; the second slider below uses a 192px control. Apply thickness overrides to Slider.Track with data-[orientation=vertical]:w-2 rather than changing its height. Leave thumb positioning to Base UI.

Low
30
High
70

Each part accepts the usual className prop; you do not need a variant or color prop. Style the root’s spacing, the control’s hit area, the track’s thickness, the indicator’s fill, and the thumb independently. Include matching dark: overrides when replacing built-in dark-theme colors.

The thumb’s before pseudo-element draws the value tooltip, while after draws the interaction halo. Override the halo’s border color for hover, active, and the focused thumb’s data-[dragging] state to match your palette. Keep both layers non-interactive, preserve visible keyboard focus, and avoid replacing Base UI’s inline thumb positioning. The custom example disables the built-in tooltip before applying its own thumb treatment.

Playback speed
60%

Disable the root to prevent pointer and keyboard changes across every thumb. The track and indicator are subdued. The thumb keeps an opaque inner fill so the track does not show through it, while its border uses 50% opacity. Keep explanatory text available when users need to understand why a setting cannot be changed.

Managed retention
65 days

Retention is managed by your organization.

Slider.Root
Slider.Label
Slider.Value
Slider.Control
Slider.Track
Slider.Indicator
Slider.Thumb

API

PropTypeDefaultDescription
value number | readonly number[] — Controlled single value or range values.
defaultValue number | readonly number[] — Initial uncontrolled single value or range values.
onValueChange (value, eventDetails) => void — Runs during interaction.
onValueCommitted (value, eventDetails) => void — Runs after an interaction commits a changed value.
min / max / step number 0 / 100 / 1 Numeric bounds and increment.
largeStep number 10 Increment used by Page Up, Page Down, and modified arrow keys.
minStepsBetweenValues number 0 Minimum step distance maintained between range thumbs.
orientation horizontal | vertical horizontal Slider axis. Vertical controls default to 160px tall with a narrow, centered track; customize height on Slider.Control.
disabled boolean false Disables all thumbs.
name / form string — Native form ownership and submission metadata.
format / locale Intl.NumberFormatOptions / Intl.LocalesArgument — Formats the displayed and accessible numeric value.
Thumb.showTooltip boolean true Shows the active thumb value while dragging or using the keyboard.
className string — Each part accepts custom styling. Apply track thickness, indicator fill, and thumb or state-layer overrides to the corresponding part.
native props React.Base UI Slider props — Forwards native attributes, events, aria-*, data-*, className, style, and ref.

Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.

Slider.Label names a single-thumb slider automatically. Name every thumb separately in a range. Arrow keys change by step; Page Up and Page Down use largeStep; Home and End move to the minimum and maximum. In vertical orientation, Up increases the value and Down decreases it, and the native range input exposes aria-orientation="vertical".

Visible focus remains on the active thumb, and disabled thumbs are removed from interaction. Use labels and value outputs to communicate the setting rather than relying on track color. Preserve native keyboard behavior and sufficient contrast when applying custom styles.