Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-autocomplete-input

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-autocomplete-input

Pure javascript autocomplete input for react-native

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

react-native-autocomplete-input

npm version Build Status

This is a pure javascript react-native component to display autocomplete suggestions given an array of objects respective to the input text.

Autocomplete Example

How to use react-native-autocomplete-input

Tested with RN >= 0.26.2. If you want to use RN < 0.26 try to install react-native-autocomplete-input <= 0.0.5.

First things first install the component from npmjs.org:

$ npm install --save react-native-autocomplete-input

or install HEAD from github.com:

$ npm install --save l-urence/react-native-autocomplete-input

Android

On Android please install the v.1.12 release. The v2.0.0 release don’t show the suggestion list correctly because RN for Android doesn’t support overflows (see #20).

Example

This brief example should illustrate the usage of the autocomplete:

// ...
render() {
  const { query } = this.state;
  const data = this._filterData(query)
  <Autocomplete
    data={data}
    defaultValue={query}
    onChangeText={text => this.setState({query: text})}
    renderItem={data => (
      <TouchableOpacity onPress={() =>
          this.setState({query: data})
        }
      >
        <Text>{data}</Text>
      </TouchableOpacity>
    )}
  />
}
// ...

The full example from the screenshot can be found here

react-native-autocomplete-input props

PropTypeDescription
containerStylestyleThese styles will be applied to the container which surrounds the autocomplete component.
inputContainerStylestyleThese styles will be applied to the container which surrounds the textInput component.
stylestyleThese styles will be applied to the textInput component.
dataarrayAssign an array of data objects which should be rendered in respect to the entered text.
listStylestyleThese style will be applied to the result list view.
renderItemfunctionrenderItem will be called to render the data objects which will be displayed in the result view below the text input.
onShowResultfunctiononShowResult will be called when the autocomplete suggestions appear or disappear.
renderTextInputfunctionrender custom TextInput. All props passed to this function.

Contribute

Feel free to open issues or do a PR!

Keywords

FAQs

Package last updated on 25 Sep 2016

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc