1.0.3 • Published 7 years ago
react-native-autocomplete-modal v1.0.3
To get started:
Install Native Base at first.
npm install native-base --saveThen install autocomplete module
npm i react-native-autocomplete-modal --saveImport
Import module in your project like,
import AutoComplete from "react-native-autocomplete-modal";Usage
const countries = [
{name: "Pakistan"},
{name: "Turkey"}
]
<AutoComplete
onSelect={data => console.log(data)}
dataSource={countries}
textLabel="Select Country"
searchPlaceholder='Search Country'
cancelText="Close"
textColor="white"
searchField="name"
/>| Props | Required | Type | Description |
|---|---|---|---|
| dataSource | Yes | Array | You can put either array of string, integer or object |
| searchField | No | String | If array contains strings or integers then searchFieldis not required else you have to put string like user.county.nameas a string |
| style | No | Object | Styling for Button |
| textColor | No | String | Like blue, #FFF |
| textLabel | No | String | Like Select option or Choose one |
| value | No | String | Selected value can be set |
| searchPlaceholder | No | String | Like Search country |
| cancelText | No | String | Like Cancel |