Skip to content
nexubDesign System
v12.7.0

Components · Interactive

Slider

StableAdded v0.0.1

Range slider built on Radix UI Slider.

import { Slider } from '@nexub/react';
View as Markdown

Playground

Props

size
TSX
<Slider defaultValue={[50]} max={100} min={0} />

Examples

Default

Range

States

  • default
  • disabled
  • invalid
  • readOnly
  • size="sm"
  • size="md"
  • size="lg"

Props

Props
PropTypeDefaultDescription
valuenumber[]—The controlled value of the slider.
defaultValuenumber[]—The initial value when uncontrolled.
minnumber—The minimum value of the slider.
maxnumber—The maximum value of the slider.
stepnumber—The step increment between values.
disabledboolean—Disables slider interaction when true.
onValueChange(value: number[]) => void—Callback fired when the value changes.
formatValue((value: number) => string)—Formats the bubble and each thumb's aria-valuetext.
invalidboolean—Error-coloured range and thumb, aria-invalid on the root.
marksSliderMark[]—Ticks along the track, optionally labelled ([0, { value: 50, label: '50%' }, 100]).
readOnlyboolean—Focusable but pointer and keys do not change the value; aria-readonly on each thumb.
showValuefalse | true | 'hover'—Value bubble above each thumb: true always, 'hover' on hover, focus and drag.
size'sm' | 'md' | 'lg''md'Track thickness and thumb size; md is the default.
thumbLabelsstring[]—Accessible name per thumb (e.g. ['Minimum', 'Maximum']). Falls back to aria-label.