Components · Interactive
Slider
StableAdded v0.0.1
Range slider built on Radix UI Slider.
import { Slider } from '@nexub/react';Playground
Props
size
<Slider defaultValue={[50]} max={100} min={0} />Examples
Default
Range
States
defaultdisabledinvalidreadOnlysize="sm"size="md"size="lg"
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| value | number[] | — | The controlled value of the slider. |
| defaultValue | number[] | — | The initial value when uncontrolled. |
| min | number | — | The minimum value of the slider. |
| max | number | — | The maximum value of the slider. |
| step | number | — | The step increment between values. |
| disabled | boolean | — | 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. |
| invalid | boolean | — | Error-coloured range and thumb, aria-invalid on the root. |
| marks | SliderMark[] | — | Ticks along the track, optionally labelled ([0, { value: 50, label: '50%' }, 100]). |
| readOnly | boolean | — | Focusable but pointer and keys do not change the value; aria-readonly on each thumb. |
| showValue | false | 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. |
| thumbLabels | string[] | — | Accessible name per thumb (e.g. ['Minimum', 'Maximum']). Falls back to aria-label. |
On iOS & Android: Slider
@nexub/react-nativeAlpha
import { Slider } from '@nexub/react-native';
<Slider label="Volume" defaultValue={40} formatValue={(v) => `${v}%`} />Web vs mobile
Same tokens and prop names. Where the platforms differ:
| Web | iOS & Android | |
|---|---|---|
| Label | Compose Label + control + HelperText (or FormField). | One component: label, helperText and error are props. |
Interactive preview of @nexub/react-native rendered for the web. Native chrome (switches, pickers, Liquid Glass) looks like the platform on a device.
On device

iPhone (iOS simulator)

Pixel (Android emulator)
Screenshots from the latest CI run of the showcase app; the live frame renders the same code for the web.
Slider props
| Prop | Type | Default | Description |
|---|---|---|---|
| labelrequired | string | — | — |
| value | number | — | — |
| defaultValue | number | — | — |
| onValueChange | (value: number) => void | — | — |
| min | number | 0 | — |
| max | number | 100 | — |
| step | number | 1 | — |
| disabled | boolean | — | — |
| formatValue | (value: number) => string | — | Announced value text, e.g. (v) => ${v}%. |
| style | StyleProp<ViewStyle> | — | — |