# Slider — React Native component for Expo

> A native-driver slider with a swelling thumb, tap-to-seek and a two-thumb range mode.

A slider that feels native on iPhone and Android: thumb and fill ride the native driver, the thumb swells under your finger, tap the track to seek, and values spring-snap to the step. Thin iOS track, a Control-Center style bar with an icon that inverts as the fill passes, a stepped track with ticks, and two-thumb range mode with an optional histogram.

- Docs: https://expokit.in/docs/components/slider
- Tier: Free
- Also called: range slider, seekbar, dual thumb slider
- Category: Inputs
- Platforms: iOS, Android, web
- Expo Go: yes, no development build needed
- npm dependencies: react-native-svg
- Uses ExpoKit items: kit
- Variants: Control Center, Default, Price Range, Font Size, Sizes, Colors

## Installation

Run once per project: `npx @expokit/cli@latest init` (shared theme + KitProvider). Then:

```bash
npx @expokit/cli@latest add slider
```

The CLI copies the source into your project (you own the code) and installs react-native-svg.

Import: `import { Slider } from "@/components/ui/slider";`

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value / defaultValue` | `number \| [number, number]` | `min / [min, max]` | Controlled or uncontrolled. A number, or [from, to] when range is set (typed by the range prop). |
| `onValueChange` | `(value) => void` | — | Fires when the stepped value changes (drag, tap, icon or accessibility action). |
| `onSlidingStart / onSlidingComplete` | `(value) => void` | — | Drag lifecycle. |
| `min / max / step` | `number` | `0 / 100 / 1` | Bounds and snap interval (0 = continuous). Coarse steps spring between positions; fine ones follow the finger and snap on release. |
| `range` | `boolean` | `false` | Two thumbs selecting a span; value becomes [from, to]. |
| `variant` | `"default" \| "bar" \| "stepped"` | `"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"` | `"md"` | Scales track, thumb, bar height and text. Hit area is always ≥ 44pt. |
| `marks` | `boolean \| (number \| { value, label })[]` | `stepped: true` | Ticks at every step, or custom values with labels under the track. |
| `showValue` | `"drag" \| "always" \| "never"` | `"drag" (bar: "never")` | Value tooltip above the thumb. On a bar, "always" shows the value inside the bar instead. |
| `formatValue` | `(value) => string` | — | Text for the tooltip, labels and accessibility value. |
| `showMinMax / minLabel / maxLabel` | `boolean / string / string` | — | Labels under both ends of the track (formatted min / max by default). |
| `icon` | `SliderIconName \| ReactNode \| (color) => ReactNode` | — | Bar only: icon inside the bar that changes colour as the fill passes over it. |
| `leftIcon / rightIcon` | `SliderIconName \| ReactNode \| (color) => ReactNode` | — | Icon beside the track. Built-ins ('volume-low', 'volume-high', 'volume-off', 'sun-low', 'sun-high', 'minus', 'plus') step the value when tapped. |
| `thickFill` | `boolean` | `false` | Default variant: draws the fill thicker than the track. |
| `histogram / histogramHeight` | `number[] / number` | `— / 44` | Bars above the track; bars inside the selection use the accent. |
| `disabled` | `boolean` | `false` | Dims and ignores touches. |
| `accent` | `string` | `theme accent` | Fill colour. |
| `accessibilityLabel` | `string` | — | Announced with the adjustable role; range thumbs get “minimum” / “maximum”. |
| `style / trackStyle / fillStyle / thumbStyle / labelStyle` | `StyleProp` | — | Root, inactive track, active fill, thumb and value text. |
| `className` | `string` | — | Tailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides. |

## 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'.

## FAQ

### How do I make a range slider in React Native?

Use ExpoKit's Slider: run 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?

Yes. Slider runs in Expo Go on iOS and Android with no development build — its packages (react-native-svg) are all included in Expo Go.

### How do I add Slider to my Expo app?

Run 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?

Yes. Slider is free: its full source is on this page and the CLI installs it without an account.

### Can I change how Slider looks?

Yes. It takes its colours, radius and light / dark mode from 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.

## More

- Live preview, variants and code: https://expokit.in/docs/components/slider
- Every ExpoKit component, screen, template and chart: https://expokit.in/llms.txt
- Install commands and props for every free component: https://expokit.in/llms-full.txt
- Pricing: https://expokit.in/pricing
