Applies to every preview on the site.
Installation
One command copies the source into your app — you own the code and can change anything.
After you add the file, import it like any local component:
import { Slider } from "@/components/ui/slider";Or add it with the CLI (installs any missing peers):
Usage
useKit(). Wrap your app in <KitProvider accent="#6366f1" radius={14}> to re-skin every component at once.Like this? There's a lot more in Pro Pro
12 full screens built from the same kit — install them the same way.
Props
| Prop | Type | Default |
|---|---|---|
| value / defaultValue Controlled or uncontrolled. A number, or [from, to] when range is set (typed by the range prop). | number | [number, number] | min / [min, max] |
| onValueChange Fires when the stepped value changes (drag, tap, icon or accessibility action). | (value) => void | — |
| onSlidingStart / onSlidingComplete Drag lifecycle. | (value) => void | — |
| min / max / step Bounds and snap interval (0 = continuous). Coarse steps spring between positions; fine ones follow the finger and snap on release. | number | 0 / 100 / 1 |
| range Two thumbs selecting a span; value becomes [from, to]. | boolean | false |
| variant Thin track + round thumb, a tall Control-Center bar with no thumb, or a track with a tick at every step. | "default" | "bar" | "stepped" | "default" |
| size Scales track, thumb, bar height and text. Hit area is always ≥ 44pt. | "sm" | "md" | "lg" | "md" |
| marks Ticks at every step, or custom values with labels under the track. | boolean | (number | { value, label })[] | stepped: true |
| showValue Value tooltip above the thumb. On a bar, "always" shows the value inside the bar instead. | "drag" | "always" | "never" | "drag" (bar: "never") |
| formatValue Text for the tooltip, labels and accessibility value. | (value) => string | — |
| showMinMax / minLabel / maxLabel Labels under both ends of the track (formatted min / max by default). | boolean / string / string | — |
| icon Bar only: icon inside the bar that changes colour as the fill passes over it. | SliderIconName | ReactNode | (color) => ReactNode | — |
| leftIcon / rightIcon Icon beside the track. Built-ins ('volume-low', 'volume-high', 'volume-off', 'sun-low', 'sun-high', 'minus', 'plus') step the value when tapped. | SliderIconName | ReactNode | (color) => ReactNode | — |
| thickFill Default variant: draws the fill thicker than the track. | boolean | false |
| histogram / histogramHeight Bars above the track; bars inside the selection use the accent. | number[] / number | — / 44 |
| disabled Dims and ignores touches. | boolean | false |
| accent Fill colour. | string | theme accent |
| accessibilityLabel Announced with the adjustable role; range thumbs get “minimum” / “maximum”. | string | — |
| style / trackStyle / fillStyle / thumbStyle / labelStyle Root, inactive track, active fill, thumb and value text. | StyleProp | — |
| className Tailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides. | string | — |
Customization
You own the source file — tune appearance with props (no fork required for most tweaks). For brand-wide colours and radius, wrap your app in KitProvider; for one-off looks, use the style props below.
Design theme
Open Design theme on the live preview — accent, corner radius and font update every variant instantly (same as KitProvider in your app).
Variants
Pick the Variants chip above the preview, or set variant=… — "default" | "bar" | "stepped".
Style props
React Native style and typed slots like fieldStyle, plus optional root className when you use NativeWind or Uniwind (cnProps from kit).
- variant
- "default" | "bar" | "stepped" · default "default"Thin track + round thumb, a tall Control-Center bar with no thumb, or a track with a tick at every step.
- size
- "sm" | "md" | "lg" · default "md"Scales track, thumb, bar height and text. Hit area is always ≥ 44pt.
- accent
- string · default theme accentFill colour.
- style / trackStyle / fillStyle / thumbStyle / labelStyle
- StylePropRoot, inactive track, active fill, thumb and value text.
- className
- stringTailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides.
Map tokens from your design system on Bring your design system or read Theming for KitProvider and NativeWind / Uniwind setup.
Behaviour & accessibility
- Touch
- Tap anywhere on the track to seek, or grab a thumb and drag. Built-in leftIcon and rightIcon names step the value down or up when tapped.
- Motion
- Thumb and fill move on the native driver; the thumb swells under your finger and values spring-snap to the step.
- Screen readers
- Single mode is one adjustable element with min, max, current value and increment / decrement actions. In range mode each thumb is its own adjustable, labelled 'minimum' and 'maximum'.
Source
FAQ
How do I make a range slider in React Native?
npx @expokit/cli@latest add slider in your Expo or React Native project and it copies a ready-made range slider into your app as plain TypeScript you can edit. It works on iOS, Android and web, and in Expo Go.Does Slider work in Expo Go?
react-native-svg) are all included in Expo Go.How do I add Slider to my Expo app?
npx @expokit/cli@latest add slider in your project. The CLI copies the component's source into your app and installs react-native-svg, so the code is yours to change.Is Slider free?
Can I change how Slider looks?
useKit(), so wrapping your app in <KitProvider accent radius> re-skins it with every other ExpoKit component. The code lives in your project, so you can also edit anything directly.