React Native Select dropdown
rn-select-dropdown is a customized select menu for react native that works for android and ios platforms.
Installation
# Using npm
npm i @mamodesaebsaad/rn-select-dropdown
Usage
import Select from "@mamodesaebsaad/rn-select-dropdown";
...
const [value, setValue] = React.useState();
...
<Select title="Currency"
data={["£", "$", "MUR", "€"]}
value={value}
onChangeValue={setValue}
search={true}
closeButton={true}
searchBoxContainer={{ borderWidth: 0, backgroundColor: '#f5f5f5' }}
searchTextInputStyle={{ backgroundColor: 'white' }}
buttonStyle={{ backgroundColor: 'red', borderWidth: 0 }}
buttonTextStyle={{ color: 'white' }}
/>
Props
data
array of data that will be represented in dropdown
value
value of the selected option
onChangeValue
Method onChange
Type | Required |
---|
Hook (useState) | Yes |
search
Enable/Disable Search in the dropdown
closeButton
Enable/Disable close button in the dropdown
searchBoxContainer
Styling of the SearchBox Container
searchTextInputStyle
Styling of the SearchBox Input style
buttonStyle
Styling of the close button style in the dropdown
buttonTextStyle
Styling of the close button text style in the dropdown