
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
react-native-element-dropdown
Advanced tools
A react-native dropdown component easy to customize for both iOS and Android.
A React Native dropdown component easy to customize for both iOS and Android.
npm install react-native-element-dropdown --save
or
yarn add react-native-element-dropdown
react-native link react-native-element-dropdown
cd ios && pod install
Props | Params | isRequire | Description |
---|---|---|---|
data | Array | Yes | |
labelField | String | Yes | |
valueField | String | Yes | |
onChange | (item) => void | Yes | |
value | Item | No | |
placeholder | String | No | |
placeholderStyle | TextStyle | No | |
selectedTextStyle | TextStyle | No | |
selectedTextProps | TextProps | No | |
style | ViewStyle | No | |
containerStyle | ViewStyle | No | |
fontFamily | String | No | |
iconColor | String | No | |
activeColor | String | No | |
search | Boolean | No | |
inputSearchStyle | ViewStyle | No | |
searchPlaceholder | String | No | |
maxHeight | Number | No | |
disable | Boolean | No | |
renderLeftIcon | () => JSX.Element | No | |
renderRightIcon | () => JSX.Element | No | |
renderItem | (item) => JSX.Element | No | |
onFocus | () => void | No | |
onBlur | () => void | No |
Props | Params | isRequire | Description |
---|---|---|---|
data | Array | Yes | |
labelField | String | Yes | |
valueField | String | Yes | |
onChange | (value[]) => void | Yes | |
value | Item[] | No | |
placeholder | String | No | |
placeholderStyle | TextStyle | No | |
style | ViewStyle | No | |
containerStyle | ViewStyle | No | |
fontFamily | String | No | |
iconColor | String | No | |
activeColor | String | No | |
selectedStyle | ViewStyle | No | |
selectedTextStyle | TextStyle | No | |
search | Boolean | No | |
inputSearchStyle | ViewStyle | No | |
searchPlaceholder | String | No | |
maxHeight | Number | No | |
disable | Boolean | No | |
renderLeftIcon | () => JSX.Element | No | |
renderRightIcon | () => JSX.Element | No | |
renderItem | (item) => JSX.Element | No | |
renderSelectedItem | (item, unSelect?: (item) => void) => JSX.Element | No | |
onFocus | () => void | No | |
onBlur | () => void | No |
Props | Params | isRequire | Description |
---|---|---|---|
imageField | String | Yes | |
imageStyle | ImageStyle | No |
import React, {useState} from 'react';
import {StyleSheet, View, Text, Image} from 'react-native';
import {Dropdown, MultiSelect} from 'react-native-element-dropdown';
const data = [
{label: 'Item 1', value: '1'},
{label: 'Item 2', value: '2'},
{label: 'Item 3', value: '3'},
{label: 'Item 4', value: '4'},
{label: 'Item 5', value: '5'},
{label: 'Item 6', value: '6'},
{label: 'Item 7', value: '7'},
{label: 'Item 8', value: '8'},
];
const DropdownScreen = _props => {
const [dropdown, setDropdown] = useState(null);
const [selected, setSelected] = useState([]);
const _renderItem = item => {
return (
<View style={styles.item}>
<Text style={styles.textItem}>{item.label}</Text>
<Image style={styles.icon} source={require('./assets/tick.png')} />
</View>
);
};
return (
<View style={styles.container}>
<Dropdown
style={styles.dropdown}
data={data}
search
searchPlaceholder="Search"
labelField="label"
valueField="value"
placeholder="Select item"
value={dropdown}
onChange={item => {
setDropdown(item.value);
console.log('selected', item);
}}
renderLeftIcon={() => (
<Image style={styles.icon} source={require('./assets/account.png')} />
)}
renderItem={item => _renderItem(item)}
/>
<MultiSelect
style={styles.dropdown2}
data={data}
labelField="label"
valueField="value"
placeholder="Select item"
search
searchPlaceholder="Search"
value={selected}
onChange={item => {
setSelected(item);
console.log('selected', item);
}}
renderItem={item => _renderItem(item)}
/>
</View>
);
};
export default DropdownScreen;
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'white',
padding: 40,
},
dropdown: {
backgroundColor: 'white',
borderBottomColor: 'gray',
borderBottomWidth: 0.5,
marginTop: 20,
},
dropdown2: {
backgroundColor: 'white',
borderColor: 'gray',
borderWidth: 0.5,
marginTop: 20,
padding: 8,
},
icon: {
marginRight: 5,
width: 18,
height: 18,
},
item: {
paddingVertical: 17,
paddingHorizontal: 4,
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
},
textItem: {
flex: 1,
fontSize: 16,
},
});
FAQs
React Native Element Dropdown is a library that provides a customizable dropdown component for React Native applications.
The npm package react-native-element-dropdown receives a total of 89,985 weekly downloads. As such, react-native-element-dropdown popularity was classified as popular.
We found that react-native-element-dropdown 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
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.