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

react-native-autosuggest

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-autosuggest

an autosuggest text input implementation for react native.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
47
increased by2.17%
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 24 Dec 2017

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