Picker
Picker Component, support single or multiple selection, blurModel and native wheel picker
(code example)
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β
customLoaderElementβ
Custom loader element
ReactNode
customPickerPropsβ
Custom picker props (when using renderPicker, will apply on the button wrapper)
object
enableModalBlurβ
iOS onlyβ
Adds blur effect to picker modal
boolean
fieldTypeβ
Pass for different field type UI (form, filter or settings)
PickerFieldTypes
getLabelβ
A function that returns the label to show for the selected Picker value
(value: string | number) => void
itemsβ
Data source for Picker
{label: string, value: string | number}[]
listPropsβ
Pass props to the list component that wraps the picker options (allows to control FlatList behavior)
FlatListProps
migrateβ
Temporary prop required for migration to Picker's new API
boolean
modeβ
SINGLE mode or MULTI mode
SINGLE | MULTI
onChangeβ
Callback for when picker value change
(value: string | number) => void
onPressβ
Add onPress callback for when pressing the picker
() => void
onSearchChangeβ
Callback for picker modal search input text change (only when passing showSearch)
(searchValue: string, filteredItems?: PickerFilteredItems) => void
pickerModalPropsβ
Pass props to the picker modal
ModalProps
renderCustomModalβ
Render custom picker modal
({visible, children, toggleModal}) => void)
renderCustomSearchβ
Render custom search input (only when passing showSearch)
(props) => void
renderItemβ
Render custom picker item
(value, {{...props, isSelected}}, itemLabel) => void
renderPickerβ
Render custom picker - input will be value (see above)\Example:\renderPicker = (selectedItem) => {...}
(selectedItem, itemLabel) => void
searchPlaceholderβ
Placeholder text for the search input (only when passing showSearch)
string
searchStyleβ
Style object for the search input (only when passing showSearch)
{color: string, placeholderTextColor: string, selectionColor: string}
selectionLimitβ
Limit the number of selected items
number
showLoaderβ
Show a loader (while items are loading/fetching)
boolean
showSearchβ
Show search input to filter picker items by label
boolean
topBarPropsβ
The picker modal top bar props
Modal's TopBarProps
useSafeAreaβ
Add safe area in the Picker modal view
boolean
useWheelPickerβ
Use wheel picker instead of a list picker
boolean
valueβ
Picker current value
string | number