A select-like input component for projects leveraging react-native-paper.
- Single or multi-select input that supports
undefinedvalue - Can be a controlled or uncontrolled input
- Easy to use with sensible defaults, react-native-paper theme support
- Accepts a render function for custom components
- Has
dropdownormodalmenu variants- Default:
modalin mobile environments, otherwisedropdown
- Default:
- Options can be any collection, or simply an array of strings. For collections:
- Default: Use
value,keyoridkeys for option values - Default: Use
labelkey for option label - Also accepts functions to map options to values and labels
- Default: Use
valuecan beundefinedwith clear selection support
- react-native
- react-native-vector-icons
- react-native-paper
npm install @rcarls/react-native-paper-selector
yarn add @rcarls/react-native-paper-selectimport * as React from 'react';
import { PaperSelect } from '@rcarls/react-native-paper-select';
const options = ['one', 'two', 'three'];
const MyComponent = () => {
const [value, setValue] = React.useState('');
return (
<PaperSelect
label="Example"
options={options}
onSelection={(option) => setValue(option)}
/>
);
};
export default MyComponent;You can run the example module by performing these steps:
yarn && yarn example webSee the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library