Skip to main content

Migrate from react-native-element-dropdown

Dropdown and MultiSelect are one component, Select, with multiple for the second. Options always have label and value, so labelField and valueField go away, and onValueChange gets the value with the option next to it.

- import { Dropdown } from 'react-native-element-dropdown';
+ import { Select } from 'patine-ui';

- <Dropdown
- data={fruits}
- labelField="label"
- valueField="value"
- placeholder="Select a fruit"
- search
- searchPlaceholder="Search..."
- value={value}
- onChange={(item) => setValue(item.value)}
- />
+ <Select
+ options={fruits}
+ placeholder="Select a fruit"
+ searchable
+ searchPlaceholder="Search..."
+ value={value}
+ onValueChange={setValue}
+ />
react-native-element-dropdownPatine UI
Dropdown / MultiSelectSelect / Select multiple
data + labelField + valueFieldoptions, mapped to { label, value } once: data.map((d) => ({ label: d.name, value: d.id }))
valuevalue (an array with multiple)
onChange(item)onValueChange(value, option)
placeholderplaceholder
searchsearchable (on by default past 8 options)
searchPlaceholdersearchPlaceholder
searchQueryfilterOption(option, query); keywords on an option are searched too
maxSelectmaxSelected
disabledisabled
mode="modal"presentation="modal"
renderItem(item, selected)renderOption({ option, selected, disabled, theme })
renderLeftIconicon on each option, shown in the field for the selected one
renderSelectedItemchips by default; renderTrigger for your own field
maxHeightlistHeight

See Select for groups, icons and server search.

See all migration guides for other libraries, and Comparison for when another library is the better choice.