33Dropdown Item picker with search and autocomplete (typeahead) functionality for react native
44
55[ ![ license] ( https://img.shields.io/github/license/onmotion/react-native-autocomplete-dropdown )] ( https://img.shields.io/github/license/onmotion/react-native-autocomplete-dropdown )
6- [ ![ npm] ( https://img.shields.io/npm/v/react-native-autocomplete-dropdown.svg )] ( https://npmjs.com/package/react-native-autocomplete-dropdown )
7- [ ![ npm] ( https://img.shields.io/npm/dm/react-native-autocomplete-dropdown.svg )] ( https://npmjs.com/package/react-native-autocomplete-dropdown )
8-
9- > This is documentation for version 3.x, if you are looking docs for version 2.x, you can find it [ here] ( https://github.com/onmotion/react-native-autocomplete-dropdown/blob/main/README%5E2.md )
106
117<p style =" text-align : center ;" align =" center " >
128 <img src="./screens/Example.png" width="500px" >
@@ -19,10 +15,6 @@ Dropdown Item picker with search and autocomplete (typeahead) functionality for
1915 <img src="./screens/ios.gif" width="280px" >
2016</p >
2117
22- > Run expo snack demo [ @onmotion/react-native-autocomplete-dropdown ] ( https://snack.expo.io/@onmotion/react-native-autocomplete-dropdown-v3 )
23-
24- <img src =" ./screens/expo-qr.png " width =" 150 " >
25-
2618## Nav
2719
2820- [ react-native-autocomplete-dropdown] ( #react-native-autocomplete-dropdown )
@@ -43,13 +35,13 @@ Dropdown Item picker with search and autocomplete (typeahead) functionality for
4335Run:
4436
4537``` bash
46- npm install --save react-native-autocomplete-dropdown
38+ npm install --save react-native-autocomplete-dropdown-extended
4739```
4840
4941 or
5042
5143 ``` bash
52- yarn add react-native-autocomplete-dropdown
44+ yarn add react-native-autocomplete-dropdown-extended
5345 ```
5446
5547## Post-install Steps
@@ -82,7 +74,7 @@ Wrap your root component in `AutocompleteDropdownContextProvider` from `react-na
8274import the package
8375
8476``` js
85- import { AutocompleteDropdown } from ' react-native-autocomplete-dropdown' ;
77+ import { AutocompleteDropdown } from ' react-native-autocomplete-dropdown-extended ' ;
8678```
8779
8880### Dataset item format
@@ -225,7 +217,7 @@ export const RemoteDataSetExample2 = memo(() => {
225217
226218```
227219
228- More examples see at < https://github.com/onmotion /react-native-autocomplete-dropdown/tree/main/example >
220+ More examples see at < https://github.com/dravec /react-native-autocomplete-dropdown/tree/main/example >
229221
230222## Playground
231223
@@ -239,40 +231,42 @@ yarn ios
239231
240232## Options
241233
242- | ** Option** | ** Description** | ** Type** | ** Default** |
243- | --- | --- | --- | --- |
244- | ` dataSet ` | set of list items | array | null |
245- | ` initialValue ` | string (** id** ) or object that contain ** id** | string \| object | null |
246- | ` loading ` | loading state | bool | false |
247- | ` useFilter ` | whether use local filter by dataSet (useful set to false for remote filtering to prevent rerender twice) | bool | true |
248- | ` showClear ` | show clear button | bool | true |
249- | ` showChevron ` | show chevron (open/close) button | bool | true |
250- | ` closeOnBlur ` | whether to close dropdown on blur | bool | false |
251- | ` closeOnSubmit ` | whether to close dropdown on submit | bool | false |
252- | ` clearOnFocus ` | whether to clear typed text on focus | bool | true |
253- | ` debounce ` | wait ** ms** before call ` onChangeText ` | number | 0 |
254- | ` suggestionsListMaxHeight ` | max height of dropdown | number | 200 |
255- | ` direction ` | "up" or "down" | string | down + auto calculate |
256- | ` bottomOffset ` | for calculate dropdown direction (e.g. tabbar) | number | 0 |
257- | ` onChangeText ` | event textInput onChangeText | function | |
258- | ` onSelectItem ` | event onSelectItem | function | |
259- | ` onOpenSuggestionsList ` | event onOpenSuggestionsList | function | |
260- | ` onChevronPress ` | event onChevronPress | function | |
261- | ` onClear ` | event on clear button press | function | |
262- | ` onSubmit ` | event on submit KB button press | function | |
263- | ` onBlur ` | event fired on text input blur | function | |
264- | ` onFocus ` | event on focus text input | function | |
265- | ` renderItem ` | JSX for render item ` (item, searchText) => JSX \| null ` if return null then the element will not be displayed | function | item.title |
266- | ` controller ` | return reference to module controller with methods ** close, open, toggle, clear, setInputText, setItem** | function | |
267- | ` containerStyle ` | | ViewStyle | |
268- | ` rightButtonsContainerStyle ` | | ViewStyle | |
269- | ` suggestionsListContainerStyle ` | | ViewStyle | |
270- | ` suggestionsListTextStyle ` | | TextStyle | styles of suggestions list text items |
271- | ` ChevronIconComponent ` | | React.Component | Feather chevron icon |
272- | ` ClearIconComponent ` | | React.Component | Feather x icon |
273- | ~~ ScrollViewComponent~~ | removed in 2.0.0 based on FlatList | React.Component name | ScrollView that provide suggestions content |
274- | ` EmptyResultComponent ` | replace the default `` Component on empty result | React.Component | |
275- | ` InputComponent ` | input element component | React.ComponentType | TextInput |
276- | ` emptyResultText ` | replace the default "Nothing found" text on empty result | string | "Nothing found" |
277- | ` textInputProps ` | text input props | TextInputProps | |
278- | ` flatListProps ` | props for \ component | FlatListProps\ | |
234+ | ** Option** | ** Description** | ** Type** | ** Default** |
235+ | --- | -----------------------------------------------------------------------------------------------------------------| --- | -----------------------------------------------|
236+ | ` dataSet ` | set of list items | array | null |
237+ | ` initialValue ` | string (** id** ) or object that contain ** id** | string \| object | null |
238+ | ` loading ` | loading state | bool | false |
239+ | ` useFilter ` | whether use local filter by dataSet (useful set to false for remote filtering to prevent rerender twice) | bool | true |
240+ | ` showClear ` | show clear button | bool | true |
241+ | ` showChevron ` | show chevron (open/close) button | bool | true |
242+ | ` closeOnBlur ` | whether to close dropdown on blur | bool | false |
243+ | ` closeOnSubmit ` | whether to close dropdown on submit | bool | false |
244+ | ` clearOnFocus ` | whether to clear typed text on focus | bool | true |
245+ | ` ignoreAccents ` | ignore diacritics | bool | true |
246+ | ` debounce ` | wait ** ms** before call ` onChangeText ` | number | 0 |
247+ | ` suggestionsListMaxHeight ` | max height of dropdown | number | 200 |
248+ | ` direction ` | "up" or "down" | string | down + auto calculate |
249+ | ` matchFrom ` | whether match suggestions from start of titles or anywhere in the title. Possible values are "any" or "start" | string | any |
250+ | ` bottomOffset ` | for calculate dropdown direction (e.g. tabbar) | number | 0 |
251+ | ` onChangeText ` | event textInput onChangeText | function | |
252+ | ` onSelectItem ` | event onSelectItem | function | |
253+ | ` onOpenSuggestionsList ` | event onOpenSuggestionsList | function | |
254+ | ` onChevronPress ` | event onChevronPress | function | |
255+ | ` onClear ` | event on clear button press | function | |
256+ | ` onSubmit ` | event on submit KB button press | function | |
257+ | ` onBlur ` | event fired on text input blur | function | |
258+ | ` onFocus ` | event on focus text input | function | |
259+ | ` renderItem ` | JSX for render item ` (item, searchText) => JSX \| null ` if return null then the element will not be displayed | function | item.title |
260+ | ` controller ` | return reference to module controller with methods ** close, open, toggle, clear, setInputText, setItem** | function | |
261+ | ` containerStyle ` | | ViewStyle | |
262+ | ` rightButtonsContainerStyle ` | | ViewStyle | |
263+ | ` suggestionsListContainerStyle ` | | ViewStyle | |
264+ | ` suggestionsListTextStyle ` | | TextStyle | styles of suggestions list text items |
265+ | ` ChevronIconComponent ` | | React.Component | Feather chevron icon |
266+ | ` ClearIconComponent ` | | React.Component | Feather x icon |
267+ | ~~ ScrollViewComponent~~ | removed in 2.0.0 based on FlatList | React.Component name | ScrollView that provide suggestions content |
268+ | ` EmptyResultComponent ` | replace the default `` Component on empty result | React.Component | |
269+ | ` InputComponent ` | input element component | React.ComponentType | TextInput |
270+ | ` emptyResultText ` | replace the default "Nothing found" text on empty result | string | "Nothing found" |
271+ | ` textInputProps ` | text input props | TextInputProps | |
272+ | ` flatListProps ` | props for \ component | FlatListProps\ | |
0 commit comments