# react-native-autosuggest

> an autosuggest text input implementation for react native.

Latest version **1.0.1** (published 2017-12-24) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install react-native-autosuggest
pnpm add react-native-autosuggest
yarn add react-native-autosuggest
bun add react-native-autosuggest
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2017-12-24 |
| First published | 2017-01-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 49 |
| Author | Seth Silesky |
| Maintainers | silesky |

## Links

- npm: https://www.npmjs.com/package/react-native-autosuggest
- Repository: https://github.com/silesky/react-native-autosuggest
- Homepage: https://github.com/silesky/react-native-autosuggest#readme
- Issues: https://github.com/silesky/react-native-autosuggest/issues
- npm.io page: https://npm.io/package/react-native-autosuggest

## Dependencies (1)

- [prop-types](https://npm.io/package/prop-types.md) ^15.5.10

## Recent versions

- 1.0.1 (latest) — 2017-12-24
- 1.0.0 — 2017-12-23
- 0.0.21 — 2017-06-24
- 0.0.19 — 2017-03-07
- 0.0.18 — 2017-02-22
- 0.0.17 — 2017-02-13
- 0.0.16 — 2017-02-13
- 0.0.15 — 2017-02-12
- 0.0.14 — 2017-02-12
- 0.0.13 — 2017-02-12
- 0.0.12 — 2017-02-11
- 0.0.11 — 2017-02-07
- 0.0.10 — 2017-01-29
- 0.0.9 — 2017-01-29
- 0.0.8 — 2017-01-28
- … 7 more at https://npm.io/package/react-native-autosuggest/versions

## README

# AutoSuggest TextInput Component


![alt tag](https://raw.githubusercontent.com/silesky/react-native-autosuggest/259c32a3cec308e30994d708f4abeb33572ed6b9/demo.gif)

## Installation
* `npm install autosuggest --save`

___

## Example:

check the [index.ios.js](https://github.com/silesky/AutosuggestExample/blob/master/index.ios.js) in the example repo.

~~import { TextInput } from 'react-native'~~
`import AutoSuggest from 'react-native-autosuggest';`
```js
   <AutoSuggest
      onChangeText={(text) => console.log('input changing!')}
      terms={['Apple', 'Banana', 'Orange', 'Strawberry', 'Lemon', 'Cantaloupe', 'Peach', 'Mandarin', 'Date', 'Kiwi']}
      ...
    />

```


## Props

|  Prop  | Type | Optional | Default | Description  |
|-------|-------|----------|---------|--------------|
| `onChangeText`          | Function | false  |  (prop is manadatory)  |  fired when the input changes. e.g (ev) => console.log(event)
| `terms`                 | Array    | false  |  (prop is mandatory)   |  list of suggestions. e.g ['Chicago', 'New York', 'San Francisco'] |
| `onChangeTextDebounce` | Number   |  true |  300 |  the minimum break *in milliseconds* that the onChangeText callback needs to take before firing again.   |
| `onItemPress` | Function | true |  undefined | fired when an item in the menu is pressed with that item's string value as the argument. You probably don't need this, and should just use onChangeText
| `placeholder` | String | true | '' | e.g 'please enter a name' |
| `clearBtnStyles` | Object | true | ...see src | styles that go around your clear btn |
| `clearBtnVisibility` | Bool | true | false | is the clear input button visible? |
| `clearBtn` | Array | true | undefined |  only if you want a custom btn component | [<MyCustomClearButtonComponent />]|
| `containerStyles` | Object | true | ...see src | applies to the entire application |
| `placeholderTextColor` | String | true | 'lightgrey' | placeholder text color |
| `otherTextInputProps` | Object | true | undefined | check the [TextInput](https://facebook.github.io/react-native/docs/textinput.html) docs for the full list) |
| `textInputStyles` | Object | true | undefined | applies to the TextInput component e.g {width: 400, backgroundColor: "black"})
| `rowWrapperStyles` | Object | true | undefined | applies to the View around the dropdown |
| `rowTextStyles` | Object | true | undefined | applies the dropdown text

---
_Source: https://npm.io/package/react-native-autosuggest · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
