Selection and input

Picker

One choice out of a longer list.

iOSWheel pickerAndroidCompose ExposedDropdownMenuBrings its own host — renders anywhere
iOSWheel picker
AndroidCompose ExposedDropdownMenu

Import

ts
import {Picker} from '@hzblj/kara-ui'

Props

A single choice from a list — a SwiftUI wheel picker on iOS, Material's exposed dropdown on Android. It brings its own host, so it renders outside Screen and Island as well.

PropTypeDefaultDescription
options*PickerOption[]—

The choices, in order.

value*string—

The selected option's value. Controlled: pass back what onValueChange reports.

disabledbooleanfalse

Stops the user changing the selection, and dims the picker.

onValueChange(value: string) => void—

Called with the chosen option's value.

testIDstring—

Android: the dropdown field's test tag. iOS: @expo/ui's wheel picker drops it.

options*
PickerOption[]

The choices, in order.

value*
string

The selected option's value. Controlled: pass back what onValueChange reports.

disabledfalse
boolean

Stops the user changing the selection, and dims the picker.

onValueChange
(value: string) => void

Called with the chosen option's value.

testID
string

Android: the dropdown field's test tag. iOS: @expo/ui's wheel picker drops it.

PickerOption

One choice of a Picker.

PropTypeDescription
label*string

What the user reads.

value*string

What onValueChange reports. It also keys the option, so it must be unique.

label*
string

What the user reads.

value*
string

What onValueChange reports. It also keys the option, so it must be unique.

Platform notes

  • A wheel on iOS, an exposed dropdown menu on Android.