Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
react-native-input-select
Advanced tools
A customizable dropdown selection package for react-native for android and iOS with multiple select and search capabilities.
A fully customizable dropdown selection package for react-native android and iOS with multiple select and search capabilities.
With npm
npm install react-native-input-select
With yarn
yarn add react-native-input-select
import React from 'react';
import Dropdown from 'react-native-input-select';
export default function App() {
const [country, setCountry] = React.useState();
return (
<Dropdown
label="Country"
placeholder="Select an option..."
options={[
{ name: 'Albania', code: 'AL' },
{ name: 'Åland Islands', code: 'AX' },
{ name: 'Algeria', code: 'DZ' },
{ name: 'American Samoa', code: 'AS' },
{ name: 'Andorra', code: 'AD' },
{ name: 'Angola', code: 'AO' },
{ name: 'Anguilla', code: 'AI' },
{ name: 'Antarctica', code: 'AQ' },
{ name: 'Antigua and Barbuda', code: 'AG' },
]}
optionLabel={'name'}
optionValue={'code'}
selectedValue={country}
onValueChange={(value) => setCountry(value)}
primaryColor={'green'}
/>
);
}
import React from 'react';
import Dropdown from 'react-native-input-select';
export default function App() {
const [country, setCountry] = React.useState();
return (
<Dropdown
label="Customized components in list"
placeholder="Select multiple options..."
options={countries.slice(0, 3)}
optionLabel={'name'}
optionValue={'code'}
selectedValue={country}
onValueChange={(itemValue: any) => setCountry(itemValue)}
isMultiple
primaryColor={'orange'}
dropdownStyle={{
borderWidth: 0, // To remove border, set borderWidth to 0
}}
placeholderStyle={{
color: 'purple',
fontSize: 15,
fontWeight: '500',
}}
labelStyle={{ color: 'teal', fontSize: 15, fontWeight: '500' }}
dropdownHelperTextStyle={{
color: 'green',
fontWeight: '900',
}}
modalBackgroundStyle={{
backgroundColor: 'rgba(196, 198, 246, 0.5)',
}}
helperText="The placeholder has been styled"
checkboxSize={20}
checkboxStyle={{
backgroundColor: 'purple',
borderRadius: 30, // To get a circle - add the checkboxSize and the padding size
padding: 10,
}}
checkboxLabelStyle={{ color: 'red', fontSize: 30 }}
listHeaderComponent={
<View style={styles.customComponentContainer}>
<Text style={styles.text}>
💡 You can add any component to the top of this list
</Text>
<View style={styles.fixToText}>
<Button
title="Left button"
onPress={() => Alert.alert('Left button pressed')}
color="#007AFF"
/>
<Button
title="Right button"
onPress={() => Alert.alert('Right button pressed')}
/>
</View>
</View>
}
listFooterComponent={
<View style={styles.customComponentContainer}>
<Text>You can add any component to the bottom of this list</Text>
</View>
}
/>
);
}
For more examples visit our wiki page
Proptypes | Datatype | Example |
---|---|---|
label | string | Countries |
placeholder | string | Select a country |
options | Array | [{ name: 'Albania', code: 'AL' }, { name: 'Åland Islands', code: 'AX' }] |
optionLabel | string | name |
optionValue | string | code |
error | string | This is a required field |
helperText | string | Only few countries are listed |
selectedValue | string or Array | AL or [AL, AX] |
onValueChange | function | ()=>{} |
isMultiple | Boolean | true |
isSearchable | Boolean | true |
disabled | Boolean | true |
labelStyle | Object | {color: 'red', fontSize: 15, fontWeight: '500'} |
placeholderStyle | Object | {color: 'blue', fontSize: 15, fontWeight: '500'} |
dropdownStyle | Object | {borderColor: 'blue', margin: 5, borderWidth:0 ...} |
dropdownContainerStyle | Object | {backgroundColor: 'red', width: '30%', ...} |
searchInputStyle | Object | {backgroundColor: 'red', borderRadius: 0, ...} |
selectedItemStyle | Object | {fontWeight: '600', color: 'yellow', ...} |
multipleSelectedItemStyle | Object | {backgroundColor: 'red', color: 'yellow', ...} |
modalBackgroundStyle | Object | {backgroundColor: 'rgba(196, 198, 246, 0.5)'} |
modalOptionsContainer | Object | {padding: 5} |
dropdownErrorStyle | Object | {borderWidth: 2, borderStyle: 'solid'} |
dropdownErrorTextStyle | Object | {color: 'red', fontWeight:'500'} |
dropdownHelperTextStyle | Object | {color: 'green', fontWeight:'500'} |
primaryColor | string | blue |
checkboxSize | number | 20 |
checkboxStyle | Object | {backgroundColor: 'blue', borderRadius: 30, padding: 10} |
checkboxLabelStyle | Object | {color: 'red', fontWeight:'500'} |
listHeaderComponent | React Component | <Text> You can add any component to the top of this list <Text> |
listFooterComponent | React Component | <Text> You can add any component to the bottom of this list <Text> |
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
https://user-images.githubusercontent.com/9849221/232344214-55fa5557-cfdd-42c4-a334-f93c15341b0b.mov
FAQs
A customizable dropdown selection package for react-native for android and iOS with multiple select and search capabilities.
The npm package react-native-input-select receives a total of 1,533 weekly downloads. As such, react-native-input-select popularity was classified as popular.
We found that react-native-input-select demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.