Usage
#
Examples#
Single itemIn the following example you can select only one item.
#
Multiple itemsIn the following example you can select multiple items.
#
Propsitems
#
State variable that holds the items.
Type | Required |
---|---|
ItemType[] | true |
value
#
State variable that specifies the value of the selected item. It's an array of values for multiple item pickers.
Type | Required |
---|---|
ValueType | ValueType[] | true |
open
#
State variable that specifies whether the picker is open.
Type | Required |
---|---|
boolean | true |
containerProps
#
Adds native props for the container.
Type |
---|
ViewProps |
labelProps
#
Adds native props for the Text
element of the selected item.
Type |
---|
TextProps |
min
#
Specifies the minimum number of items.
note
This only works with multiple item pickers.
Type | Default |
---|---|
number | null |
max
#
Specifies the maximum number of items.
note
This only works with multiple item pickers.
Type | Default |
---|---|
number | null |
disabled
#
Disables the picker.
Type | Default |
---|---|
boolean | false |
maxHeight
#
Max height of the drop-down box.
Type | Default |
---|---|
number | 200 |
disableBorderRadius
#
Disables changing the border radius when opening.
Type | Default |
---|---|
boolean | false |
zIndex
#
Specifies the stack order.
Type | Default |
---|---|
number | 5000 |
- See: Multiple Pickers
zIndexInverse
#
Specifies the inverse stack order.
Type | Default |
---|---|
number | 6000 |
- See: Multiple Pickers
#
CallbackssetOpen
#
State callback that is called when the user presses the picker.
Type | Required |
---|---|
(open: boolean) => void | true |
setItems
#
State callback that is called to modify or add new items.
Type | Required |
---|---|
(callback: SetStateAction) => void | true |
setValue
#
State callback that is called when the value
changes.
Type | Required |
---|---|
(callback: SetStateAction) => void | true |
onPress
#
Callback that is called as soon as the user presses the picker.
Type |
---|
(open: boolean) => void |
onOpen
#
Callback that is called when the user opens the picker.
Type |
---|
() => void |
onClose
#
Callback that is called when the user closes the picker.
Type |
---|
() => void |