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/uiIf 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: 1The maximum value of the slider. Updating this value does not trigger callbacks if the current value is above max.
Optional • Type:
number • Default: 0The minimum value of the slider. Updating this value does not trigger callbacks if the current value is below min.
Optional • Type:
(value: number) => voidCallback triggered on dragging along the slider.
Optional • Type:
number • Default: 0The number of steps between the minimum and maximum values, 0 signifies infinite steps.