0.6.0 • Published 4 years ago

native-autocomplete-input v0.6.0

Weekly downloads
38
License
MIT
Repository
github
Last release
4 years ago

native-autocomplete-input

This is an auto complete input component for react-native. For the native, Android use AutoCompleteTextView, iOS use UITextField.

For now, we only implement the Android, iOS is on the way.

Installation

npm install native-autocomplete-input

Usage

import AutoCompleteInputView from "native-autocomplete-input";

// ...

      <AutoCompleteInputView
        suggestions={['android', 'apple', 'bob', 'banana']}
        onChangeText={(value: string) => {
          console.log(value);
        }}
        onChangeSuggestion={(index:number, value:string) =>{
          console.log('index', index, 'value', value);
        }}
        textColor={'#f00'}
        style={styles.box}
      />

Props

PropTypeDescription
suggestionsstring arrayAn array with suggestion items
textColorstring of rgbaText color of the input view
fontSizenumberFont size for the input view
onChangeTextFunctionCallback that is called when the text input's text changes. Changed text is passed as an argument to the callback handler
defaultValuestringDefault value for the input view
placeholderColorstring of colorText color of the input view holder
placeholderstringPlaceholder for text input view
onChangeSuggestionFunctionCallback while user select suggestion

TODO

  • iOS support
  • Custom style for the suggest item.

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

0.6.0

4 years ago

0.5.0

4 years ago

0.4.0

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago