Git Product home page Git Product logo

react-native-autosuggest's Introduction

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

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
containerStyles Object true ...see src applies to the entire application
placeholderTextColor String true 'lightgrey' placeholder text color
otherTextInputProps Object true undefined check the TextInput 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

Contributing

react-native-autosuggest's People

Contributors

silesky avatar

Watchers

James Cloos avatar Sebastián Lara avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.