Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/avishwakarma/preact-typeahead
A TypeHead component for Preact
https://github.com/avishwakarma/preact-typeahead
Last synced: about 2 months ago
JSON representation
A TypeHead component for Preact
- Host: GitHub
- URL: https://github.com/avishwakarma/preact-typeahead
- Owner: avishwakarma
- Created: 2019-10-11T14:26:38.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T22:34:14.000Z (about 2 years ago)
- Last Synced: 2023-03-29T13:29:25.748Z (almost 2 years ago)
- Language: JavaScript
- Size: 826 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TypeAhead
A TypeAhead Component for Preact
### Setup
Clone the repo
```
git clone https://github.com/ashokvishwakarma/preact-typehead.git
```install the packages
```
npm install
````Run development server
```
npm start
```Build component
```
npm run build
```Test
```
npm run test
```### TypeAhead Props
Available props and their default values
|Prop|Details|Default Value|
|----|-------|------------:|
|url|URL to fetch data from the server|`null`|
|params|Configuration object to api check example folder for more details| Check the example|
|dataKey|Key in which the data is available|`data`|
|data|Data for typeahead|`null`|
|suggestAfter |Chars to wait till the suggestions|3|
|maxItem|Maximum items to be selected|5|
|displayKey|Key to display in chips or input|`title`|
|onInput|onInput callback| function |
|onSelect|onSelect callback| function |
|hilightTerm|Highlight the matched term| `false` |
|duplicate|Allow selected item in suggestion| `false` |
|multiple|Select multiple items| `false` |
|itemBuilder|function to custom html for suggested items | NA |