1.0.1 • Published 6 years ago

react-native-autosuggest v1.0.1

Weekly downloads
89
License
MIT
Repository
github
Last release
6 years ago

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

Contributing

1.0.1

6 years ago

1.0.0

6 years ago

0.0.21

7 years ago

0.0.19

7 years ago

0.0.18

7 years ago

0.0.17

7 years ago

0.0.16

7 years ago

0.0.15

7 years ago

0.0.14

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago