Picker
Picker Component, support single or multiple selection, blurModel and native wheel picker
(code example)
tip
This component support margin, padding, position modifiers.
#
Usage<Picker value={currentValue} placeholder={'Placeholder'} onChange={() => console.log('changed')}> {_.map(items, item => ( return renderItem(item, index); ))}</Picker>
#
API#
customPickerPropsCustom picker props (when using renderPicker, will apply on the button wrapper)
object
#
enableModalBlur#
iOS onlyAdds blur effect to picker modal
boolean
#
fieldTypePass for different field type UI (form, filter or settings)
PickerFieldTypes
#
getLabelA function that returns the label to show for the selected Picker value
(value: string | number) => void
#
itemsData source for Picker
{label: string, value: string | number}[]
#
listPropsPass props to the list component that wraps the picker options (allows to control FlatList behavior)
FlatListProps
#
migrateTemporary prop required for migration to Picker's new API
boolean
#
modeSINGLE mode or MULTI mode
SINGLE | MULTI
#
onChangeCallback for when picker value change
(value: string | number) => void
#
onPressAdd onPress callback for when pressing the picker
() => void
#
onSearchChangeCallback for picker modal search input text change (only when passing showSearch)
(searchValue: string) => void
#
pickerModalPropsPass props to the picker modal
ModalProps
#
renderCustomModalRender custom picker modal
({visible, children, toggleModal}) => void)
#
renderCustomSearchRender custom search input (only when passing showSearch)
(props) => void
#
renderItemRender custom picker item
(value, {{...props, isSelected}}, itemLabel) => void
#
renderPickerRender custom picker - input will be value (see above)\Example:\renderPicker = (selectedItem) => {...}
(selectedItem, itemLabel) => void
#
searchPlaceholderPlaceholder text for the search input (only when passing showSearch)
string
#
searchStyleStyle object for the search input (only when passing showSearch)
{color: string, placeholderTextColor: string, selectionColor: string}
#
selectionLimitLimit the number of selected items
number
#
showSearchShow search input to filter picker items by label
boolean
#
topBarPropsThe picker modal top bar props
Modal's TopBarProps
#
useSafeAreaAdd safe area in the Picker modal view
boolean
#
useWheelPickerUse wheel picker instead of a list picker
boolean
#
valuePicker current value
string | number