1.0.26 • Published 1 year ago

react-native-expo-autocomplete-dropdown v1.0.26

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

React-Native-AutoComplete-DropDown

Dropdown Item picker with search and autocomplete (typeahead) functionality for react native

Demo

Example on Expo snacks

Installation

Run: npm install --save react-native-expo-autocomplete-dropdown or yarn add react-native-expo-autocomplete-dropdown

Platform

IOS and android

Usage

import AutoComplete from "react-native-expo-autocomplete-dropdown";

DateSet

dataSet property must be an array of objects or null. Object required keys are:

{
    id: 'some uniq string id',
    title: 'list item title'
}

Example with local Dataset

import { StyleSheet, Text, View } from "react-native";
import AutoComplete from "react-native-expo-autocomplete-dropdown";

export default function App() {
  const handleCallback = (childData) => {
    console.log("child", childData);
  };
  return (
    <View style={styles.container}>
      <AutoComplete
        data={[
          { id: "1", title: "Apple" },
          { id: "2", title: "banana" },
          { id: "3", title: "Amrod" },
          { id: "4", title: "pear" },
          { id: "5", title: "pine Apple" },
          { id: "6", title: "orange" },
        ]}
        widthBySide={30}
        placeholder={"select fruit"}
        backgroundColorTextInput={"black"}
        placeholderTextColor={"green"}
        borderBottomColor={"green"}
        onFocusBottomColor={"black"}
        borderRadius={7}
        borderBottomWidth={2}
        borderRadiusList={10}
        listElevation={7}
        listBackgroundColor={"white"}
        listTextColor={"black"}
        listborderBottomColor={"black"}
        parentCallback={handleCallback}
      ></AutoComplete>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: "#fff",
    alignItems: "center",
    justifyContent: "center",
  },
});

Note:

Some time scroll not work so use "flex:1" in parents component

Options

OptionDescriptionTypeDefault
dataset of list itemsarraynull
widthBySidegive Margin left Rightintnull
placeholderplaceholder valuestringnull
parentCallback={handleCallback}return objectobject
placeholderTextColorplaceholder Text Colorstringnull
borderBottomColorborder Bottom Colorstringnull
onFocusBottomColoronFocus border Bottom Colorstringnull
borderRadiusborder radius of input fieldintnull
borderBottomWidthborder Bottom Widthintfalse
borderRadiusListmenu dropdown list item radiusintnull
listElevationElevation prop for Elevation of itemintnull
listBackgroundColormenu item background colorstringnull
listTextColormenu item text colorstringnull
1.0.22

1 year ago

1.0.21

1 year ago

1.0.26

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.20

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.0

2 years ago