This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.

This is documentation for the next SDK version. For up-to-date documentation, see the latest version (SDK 57).

Slider

A slider compatible with @react-native-community/slider.

Android
iOS
Web
Included in Expo Go

A Slider component with an API compatible with @react-native-community/slider. It uses a Material 3 Slider on Android, a SwiftUI Slider on iOS, and a native <input type="range"> element on web.

Under the hood this component wraps the platform-specific @expo/ui primitives:

If you need lower-level control, use those primitives directly.

Installation

Terminal
npx expo install @expo/ui

If you are installing this in an existing React Native app, make sure to install expo in your project.

Migrating from @react-native-community/slider

  • Update the import from import Slider from '@react-native-community/slider' to import Slider from '@expo/ui/community/slider'.
  • onSlidingStart, onSlidingComplete, tapToSeek, StepMarker, renderStepNumber, thumbImage, minimumTrackImage, maximumTrackImage, trackImage, accessibilityUnits, accessibilityIncrements, testID, and ref.updateValue are not yet supported.
  • On iOS, maximumTrackTintColor and thumbTintColor have no visual effect — SwiftUI's Slider only exposes the minimum (active) track tint. minimumTrackTintColor works on both platforms.

Basic usage

SliderExample.tsx
import { useState } from 'react'; import { Text, View } from 'react-native'; import Slider from '@expo/ui/community/slider'; export default function SliderExample() { const [value, setValue] = useState(0.5); return ( <View> <Slider value={value} onValueChange={setValue} /> <Text>Value: {value.toFixed(3)}</Text> </View> ); }

API

import Slider from '@expo/ui/community/slider';

Component

Slider

Android
iOS
Web

Type: React.Element<SliderProps>

A drop-in replacement for @react-native-community/slider. Renders a SwiftUI Slider on iOS, a Material 3 Slider on Android, and a native HTML <input type="range"> on web.

Props for the Slider community drop-in component. Compatible with @react-native-community/slider.

SliderProps

disabled

Android
iOS
Web
Optional • Type: boolean • Default: false

If true the user won't be able to move the slider.

inverted

Android
iOS
Web
Optional • Type: boolean • Default: false

Reverses the direction of the slider so the maximum value is on the left and the minimum value is on the right.

lowerLimit

Android
iOS
Web
Optional • Type: number

The lower limit value of the slider. The user won't be able to slide below this limit.

maximumTrackTintColor

Android
Optional • Type: ColorValue

Color of the track to the right of the thumb.

maximumValue

Android
iOS
Web
Optional • Type: number • Default: 1

Initial maximum value of the slider.

minimumTrackTintColor

Android
iOS
Web
Optional • Type: ColorValue

Color of the track to the left of the thumb.

minimumValue

Android
iOS
Web
Optional • Type: number • Default: 0

Initial minimum value of the slider.

onValueChange

Android
iOS
Web
Optional • Type: (value: number) => void

Callback continuously called while the user is dragging the slider.

step

Android
iOS
Web
Optional • Type: number • Default: 0

Step value of the slider. The value should be between 0 and (maximumValue - minimumValue). A value of 0 means continuous (no snapping).

style

Android
iOS
Web
Optional • Type: StyleProp<ViewStyle>

Used to style and layout the Slider.

thumbTintColor

Android
Optional • Type: ColorValue

Color of the thumb.

upperLimit

Android
iOS
Web
Optional • Type: number

The upper limit value of the slider. The user won't be able to slide above this limit.

value

Android
iOS
Web
Optional • Type: number • Default: 0

Initial / current value of the slider. Behaves like the community lib: passing a new value updates the thumb, but live drag emits via onValueChange without needing external state.