Slider
A slider compatible with @react-native-community/slider.
For the complete documentation index, see llms.txt. Use this file to discover all available pages.
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:
- Android: Jetpack Compose Slider
- iOS: SwiftUI Slider
If you need lower-level control, use those primitives directly.
Installation
- npx expo install @expo/uiIf 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'toimport Slider from '@expo/ui/community/slider'. onSlidingStart,onSlidingComplete,tapToSeek,StepMarker,renderStepNumber,thumbImage,minimumTrackImage,maximumTrackImage,trackImage,accessibilityUnits,accessibilityIncrements,testID, andref.updateValueare not yet supported.- On iOS,
maximumTrackTintColorandthumbTintColorhave no visual effect — SwiftUI'sSlideronly exposes the minimum (active) track tint.minimumTrackTintColorworks on both platforms.
Basic usage
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
Type: React.Element<SliderProps>
A drop-in replacement for @react-native-community/slider on web.
Renders a native HTML <input type="range"> element.
Props for the Slider community drop-in component.
Compatible with @react-native-community/slider.
boolean • Default: falseIf true the user won't be able to move the slider.
boolean • Default: falseReverses the direction of the slider so the maximum value is on the left and the minimum value is on the right.
numberThe lower limit value of the slider. The user won't be able to slide below this limit.
ColorValueColor of the track to the right of the thumb.
ColorValueColor of the track to the left of the thumb.
(value: number) => voidCallback continuously called while the user is dragging the slider.
number • Default: 0Step value of the slider. The value should be between 0 and (maximumValue - minimumValue). A value of 0 means continuous (no snapping).
numberThe upper limit value of the slider. The user won't be able to slide above this limit.