1.1.1 • Published 4 years ago

react-native-animated-autocomplete v1.1.1

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

WIP - This package is a work in progress, not suitable to download at the moment

react-native-animated-autocomplete

A customisable animated modal based autocomplete

Installation

If you use npm:

npm install react-native-animated-autocomplete

If you use yarn:

yarn add react-native-animated-autocomplete

Usage

import * as React from 'react';

import { View } from 'react-native';
import AnimatedAutocomplete from 'react-native-animated-autocomplete';

export default function App() {
  const [formvalue, setFormValue] = useState('default value');
  return (
    <View>
      <AnimatedAutocomplete
        data={Array.from(Array(50).keys()).map(
          (item: number) => `Custom ${item}`
        )}
        value={formvalue}
        onSelectItem={(val: string) => setFormValue(val)}
      />
    </View>
  );
}

Props

Prop (required)TypeDescription
datastring[]The list of data to render in the autocomplete
valuestringThe current value in the autocomplete. A default value can be set using this
onSelectItem(valstring) => voidThe function to run when an item is selected
mainInputViewStyleViewStyleStyles to add for the input view
mainInputTextStyleTextStyleStyles to add for the input text
closeIconJSX.ElementA custom icon for the close button
searchIconJSX.ElementA custom icon for the search icon

Contributing

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

License

MIT