1.1.1 • Published 3 years ago
@evolvier/react-native-select v1.1.1
React Native Select
A multi (or single) select component
Installation
This library is available on npm, you need to have node.js installed.
install it with npm:
npm i --save @evolvier/react-native-select
Alternatively you can use yarn.
yarn add @evolvier/react-native-select
Usage
import React, { Component } from "react";
import ReactNativeSelect from "@evolvier/react-native-select";
class Example extends Component {
render() {
let data = [
{
key: "10011",
title: "William",
subtitle: "Developer",
},
{
key: "10012",
title: "Emma",
subtitle: "UI/UX Designer",
},
{
key: "10013",
title: "James",
},
];
return (
<ReactNativeSelect
items={data}
onSubmit={(selectedItem) => console.log(selectedItem)}
/>
);
}
}
Props
Property | Type | Default | Description |
---|---|---|---|
items * | Array | Array of objects to populate the list More info | |
onSubmit * | Func | Called when selectedItem(s) changes | |
type | String | select | Type of selection select or multi |
placeholderText | String | "Select Item " | Select input placeholder text |
renderItem | Func | ||
selectedItemsPosition | String | inside | Position of selected items in multi type inside or below |
renderSelectedItem | Func | ||
enableSearch | Boolean | false | Enable search |
searchInputPlaceholderText | String | "Search... " | Search box placeholder text |
renderSearchInput | Func | ||
defaultSelectedItems | Array | ||
defaultSelectedItem | String | Number | ||
hideOnBackdropPress | Boolean | false | |
disableAndroidBack | Boolean | false |
*
isRequired fields
items
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
@evolvier/react-native-select is MIT Licensed.
Copyright 2020 Evolvier Technologies. All rights reserved.