This is documentation for the next SDK version. For up-to-date documentation, see the latest version (SDK 54).
A SwiftUI ColorPicker component for selecting colors.
iOS
A color picker component that allows users to select colors from a palette.
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.
Usage
import { ColorPicker, Host } from '@expo/ui/swift-ui'; <Host style={{ width: 400, height: 200 }}> <ColorPicker label="Select a color" selection={color} onValueChanged={setColor} /> </Host>
See Official SwiftUI documentation for more information.
API
Component
Type: React.Element<ColorPickerProps>
Renders a ColorPicker
component using SwiftUI.