Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
react-native-paper-dropdown
Advanced tools
Dropdown component using React Native Paper TextInput and Menu, now also with multiselect
Material Design Dropdown Component using React Native Paper, now also with multiselect
react-native-paper
yarn add react-native-paper-dropdown
or
npm i react-native-paper-dropdown
import React, { useState } from 'react';
import { View } from 'react-native';
import { Dropdown } from 'react-native-paper-dropdown';
import { Provider as PaperProvider } from 'react-native-paper';
const OPTIONS = [
{ label: 'Male', value: 'male' },
{ label: 'Female', value: 'female' },
{ label: 'Other', value: 'other' },
];
export default function App() {
const [gender, setGender] = useState<string>();
return (
<PaperProvider>
<View style={{ margin: 16 }}>
<Dropdown
label="Gender"
placeholder="Select Gender"
options={OPTIONS}
value={gender}
onSelect={setGender}
/>
</View>
</PaperProvider>
);
}
import React, { useState } from 'react';
import { View } from 'react-native';
import { MultiSelectDropdown } from 'react-native-paper-dropdown';
import { Provider as PaperProvider } from 'react-native-paper';
const MULTI_SELECT_OPTIONS = [
{ label: 'White', value: 'white' },
{ label: 'Red', value: 'red' },
{ label: 'Blue', value: 'blue' },
{ label: 'Green', value: 'green' },
{ label: 'Orange', value: 'orange' },
];
export default function App() {
const [colors, setColors] = useState<string[]>([]);
return (
<PaperProvider>
<View style={{ margin: 16 }}>
<MultiSelectDropdown
label="Colors"
placeholder="Select Colors"
options={MULTI_SELECT_OPTIONS}
value={colors}
onSelect={setColors}
/>
</View>
</PaperProvider>
);
}
DropdownProps
Prop | Type | Description |
---|---|---|
testID | string | Test ID for the dropdown component. |
menuTestID | string | Test ID for the dropdown menu. |
value | string | The currently selected value. |
onSelect | (value: string) => void | Callback function to handle value selection. |
options | Option[] | Array of options for the dropdown. |
menuUpIcon | JSX.Element | Custom icon for menu up state. |
menuDownIcon | JSX.Element | Custom icon for menu down state. |
maxMenuHeight | number | Maximum height of the dropdown menu. |
menuContentStyle | ViewStyle | Style for the dropdown menu content. |
CustomDropdownItem | (props: DropdownItemProps) => JSX.Element | Custom component for dropdown item. |
CustomDropdownInput | (props: DropdownInputProps) => JSX.Element | Custom component for dropdown input. |
CustomMenuHeader | (props: DropdownHeaderProps) => JSX.Element | Custom component for the dropdown menu header. |
Touchable | ForwardRefExoticComponent<PressableProps & RefAttributes<View>> | Custom touchable component for the dropdown. |
placeholder | string | Placeholder text for the dropdown input. |
label | TextInputLabelProp | Label for the dropdown input. |
mode | 'flat' | 'outlined' | Mode for the dropdown input. |
disabled | boolean | Whether the dropdown is disabled. |
error | boolean | Whether the dropdown has an error. |
hideMenuHeader | boolean | Hide menu header component (default: false). |
statusBarHeight | number | Additional top margin for the status bar on Android. |
MultiSelectDropdownProps
Prop | Type | Description |
---|---|---|
testID | string | Test ID for the dropdown component. |
menuTestID | string | Test ID for the dropdown menu. |
value | string[] | The currently selected values. |
onSelect | (value: string[]) => void | Callback function to handle value selection. |
options | Option[] | Array of options for the dropdown. |
menuUpIcon | JSX.Element | Custom icon for menu up state. |
menuDownIcon | JSX.Element | Custom icon for menu down state. |
Touchable | ForwardRefExoticComponent<PressableProps & RefAttributes<View>> | Custom touchable component for the dropdown. |
maxMenuHeight | number | Maximum height of the dropdown menu. |
menuContentStyle | ViewStyle | Style for the dropdown menu content. |
CustomMultiSelectDropdownItem | (props: MultiSelectDropdownItemProps) => JSX.Element | Custom component for multi-select dropdown item. |
CustomMultiSelectDropdownInput | (props: DropdownInputProps) => JSX.Element | Custom component for multi-select dropdown input. |
CustomMenuHeader | (props: DropdownHeaderProps) => JSX.Element | Custom component for the dropdown menu header. |
placeholder | string | Placeholder text for the dropdown input. |
label | TextInputLabelProp | Label for the dropdown input. |
mode | 'flat' | 'outlined' | Mode for the dropdown input. |
disabled | boolean | Whether the dropdown is disabled. |
error | boolean | Whether the dropdown has an error. |
hideMenuHeader | boolean | Hide menu header component (default: false). |
statusBarHeight | number | Additional top margin for the status bar on Android. |
Method | Return | Description |
---|---|---|
focus() | void | Open the dropdown manually. |
blur() | void | Close the dropdown manually. |
MIT
FAQs
Dropdown component using React Native Paper TextInput and Menu, now also with multiselect
We found that react-native-paper-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
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.