0.1.9 • Published 2 years ago

react-typeahead-input-component v0.1.9

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
2 years ago

react-typeahead-input-component

Demo

https://user-images.githubusercontent.com/78295585/166108978-58251611-73af-4d49-ad98-d135d239039a.mp4

Installation

npm i react-typeahead-input-component

Usage

import Search from "react-typeahead-input-component";

##api

PropsTypeDefaultDescription
valuestringRequiredthe value of input
placeholderstring""placeholder of input
loadingbooleanfalsedetermines visibility of loading animation
resultsarray[]results array of your search query response objects
onClickfunction() => {}callback function for onChange event

onClick property takes function and passes results and payload object as a parameter to your function.

results object structure

propertiesTypeDefaultDescription
imgstring""the link to the img source
titlestringRequiredthe title of the result
subtitlestringRequiredthe subtitle of the result
payloadany""anything that will help you handle click event

payload property is the payload that you can use to handle click event. it could be anything you want. e.g id, name, email etc.

Example

import Search from "react-typeahead-input-component";

const App = () => {
  const results = [
    {
      img: "https://firebasestorage.googleapis.com/v0/b/green-b3fdd.appspot.com/o/images%2FVAJA.JPG?alt=media&token=9bc9d965-164c-4b82-a6a3-9f735f419d2b",
      title: "Vaja",
      subTitle: "Name",
      redirectUrl: "https://www.google.com",
    },
  ];
  return (
    <div className="App">
      <Search
        placeholder="Search"
        value="Georgia"
        results={results}
        onClick={(result) => console.log(result)}
      />
    </div>
  );
};
export default App;
0.1.2

2 years ago

0.1.1

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.9

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.0.49

2 years ago

0.0.40

2 years ago

0.0.41

2 years ago

0.0.42

2 years ago

0.0.43

2 years ago

0.0.44

2 years ago

0.0.45

2 years ago

0.0.46

2 years ago

0.0.47

2 years ago

0.0.37

2 years ago

0.0.38

2 years ago

0.0.39

2 years ago

0.0.30

2 years ago

0.0.31

2 years ago

0.0.32

2 years ago

0.0.33

2 years ago

0.0.34

2 years ago

0.0.35

2 years ago

0.0.36

2 years ago

0.1.0

2 years ago

0.0.26

2 years ago

0.0.27

2 years ago

0.0.28

2 years ago

0.0.29

2 years ago

0.0.20

2 years ago

0.0.21

2 years ago

0.0.22

2 years ago

0.0.23

2 years ago

0.0.25

2 years ago

0.0.15

2 years ago

0.0.16

2 years ago

0.0.17

2 years ago

0.0.18

2 years ago

0.0.19

2 years ago

0.0.10

2 years ago

0.0.11

2 years ago

0.0.12

2 years ago

0.0.13

2 years ago

0.0.14

2 years ago

0.0.48

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

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.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago