A simple, and fully customizable drop down picker.
Npm
npm install react-native-simple-dropdown-picker
Yarn
yarn add react-native-simple-dropdown-picker
You can see real example of DropDownPicker
in the test app
import DropDownPicker from 'react-native-simple-dropdown-picker';
const MySimpleComponent = () => {
const [value, setValue] = useState('');
const data = ['Hello', 'World'];
return (
<DropDownPicker
result={value}
setResult={setValue}
data={data}
placeholder={'Choose an option'}
/>
);
}
Name | Type | Default Value | Description |
---|---|---|---|
result | string or number | null | (required) State where you will place the result value picked (required) |
setResult | function | null | (required) Function to mutate result |
data | array | [] |
(required) Possible value to result. Can be an array of value or an object like {id, value} |
placeholder | string | First value of data | Text to display if the value is not initialized |
animatedIcon | component | <Image source={require('../assets/images/img.png')} /> |
Component to display at the right of the text |