This is documentation for the next SDK version. For up-to-date documentation, see the latest version (SDK 54).
A SwiftUI Slider component for selecting values from a range.
iOS
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.
Usage
import { Host, Slider } from '@expo/ui/swift-ui'; <Host style={{ minHeight: 60 }}> <Slider value={value} onValueChange={(value) => { setValue(value); }} /> </Host>
See Official SwiftUI documentation for more information.
API
Component
Type: React.Element<SliderProps>
Optional • Type:
number
• Default: 1
The maximum value of the slider. Updating this value does not trigger callbacks if the current value is above max
.
Optional • Type:
number
• Default: 0
The minimum value of the slider. Updating this value does not trigger callbacks if the current value is below min
.
Optional • Type:
(value: number) => void
Callback triggered on dragging along the slider.
Optional • Type:
number
• Default: 0
The number of steps between the minimum and maximum values, 0
signifies infinite steps.