Socket
Socket
Sign inDemoInstall

react-native-autosuggest

Package Overview
Dependencies
5
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-autosuggest

an autosuggest text input implementation for react native.


Version published
Weekly downloads
184
increased by82.18%
Maintainers
1
Install size
250 kB
Created
Weekly downloads
 

Readme

Source

AutoSuggest TextInput Component

alt tag

Installation

  • npm install autosuggest --save

Example:

check the index.ios.js in the example repo.

import { TextInput } from 'react-native' import AutoSuggest from 'react-native-autosuggest';

   <AutoSuggest
      onChangeText={(text) => console.log('input changing!')}
      terms={['Apple', 'Banana', 'Orange', 'Strawberry', 'Lemon', 'Cantaloupe', 'Peach', 'Mandarin', 'Date', 'Kiwi']}
      ...
    />

Props

PropTypeOptionalDefaultDescription
onChangeTextFunctionfalse(prop is manadatory)fired when the input changes. e.g (ev) => console.log(event)
termsArrayfalse(prop is mandatory)list of suggestions. e.g ['Chicago', 'New York', 'San Francisco']
onChangeTextDebounceNumbertrue300the minimum break in milliseconds that the onChangeText callback needs to take before firing again.
onItemPressFunctiontrueundefinedfired 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
placeholderStringtrue''e.g 'please enter a name'
clearBtnStylesObjecttrue...see srcstyles that go around your clear btn
clearBtnVisibilityBooltruefalseis the clear input button visible?
clearBtnArraytrueundefinedonly if you want a custom btn component
containerStylesObjecttrue...see srcapplies to the entire application
placeholderTextColorStringtrue'lightgrey'placeholder text color
otherTextInputPropsObjecttrueundefinedcheck the TextInput docs for the full list)
textInputStylesObjecttrueundefinedapplies to the TextInput component e.g {width: 400, backgroundColor: "black"})
rowWrapperStylesObjecttrueundefinedapplies to the View around the dropdown
rowTextStylesObjecttrueundefinedapplies the dropdown text

FAQs

Last updated on 24 Dec 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc