1.1.3 • Published 4 years ago

react-native-tomtom-autocomplete v1.1.3

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

react-native-tomtom-autocomplete

Customizable TomTom autocomplete component for iOS and Android React-Native apps

Preview

Basic With Map

Installation

  • npm
npm install react-native-tomtom-autocomplete --save
  • yarn
yarn add react-native-tomtom-autocomplete

Getting Started

Example

import React from 'react';
import AutoCompleteInput from "react-native-tomtom-autocomplete";

...

<AutoCompleteInput
    inputProps={{
        placeholder: "Search",
    }}
    onPress={(item) => console.log('item', item)}
    inputContainerStyle={{
        padding: 10,
        margin: 10,
        borderWidth: 2,
        borderColor: "grey",
    }}
    listItemsContainerStyle={{
        padding: 10,
        marginHorizontal: 10,
        borderWidth: 2,
        borderColor: "grey",
    }}
    bottomDivider
    tomtomOptions={{ key: "TOMTOM_API_KEY" }}
/>
...

Props

This list is a work in progress. PRs welcome!

Genereal Props

Proptypedescriptiondefaultrequired
tomtomOptionsTomTomOptionskey attribute with tomtom api key is must, to see the full list of optional parameters, check TomTom API Docs---true
inputContainerStyleViewStylecontainer style for text input---false
inputPropsTextInputPropsprops for text input---false
listItemsContainerStyleViewStylecontainer style for list items---false
titleExtractorfunctionfunction to define which item property will be displayed in the first line, takes api response item as the parameter items---false
subtitleExtractorfunctionfunction to define which item property will be displayed in the second line, takes api response item as the parameter items---false
disabledExtractorfunctionfunction to define for which items to apply disabled style, takes api response item as the parameter items---false
delaynumberdebounce effect for text input. This can be used to wait for user to finish typing, that will prevent unnecessary api requests for each change in text input. If you don't want a debounce effect, then set it to 0300false

Additional Props

These props are for list items, all optional.

Proptypedescription
titleStyleTextStylecustom style for title
titlePropsViewPropscustom props for title container
subtitleStyleTextStylecustom style for subtitle
subtitlePropsViewPropscustom props for subtitle container
containerStyleViewStylecustom style for outer container
onPressfunction(item: TomTomPOISearchResponseResult, event: GestureResponderEvent) => void
onLongPressfunction(item: TomTomPOISearchResponseResult, event: GestureResponderEvent) => void
leftElementReactNodecomponent to render at the left side of each list item
rightElementReactNodecomponent to render at the right side of each list item
contentContainerStyleViewStylecustom style for content container
disabledStyleViewStylethis should be used with disabledExtractor. custom style for disabled list item
bottomDividerbooleanif bottom divider should be rendered after each list istem
topDividerbooleanif bottom divider should be rendered before each list istem

Inspirations

Roadmap

  • Places autocompletion
  • iOS and Android compatibility
  • ActivityIndicatorIOS/ProgressBarAndroid loaders
  • Typescript types
  • Tests
1.1.1

4 years ago

1.1.3

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.10

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.0

4 years ago