Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/diversen/auto-complete-tags

Custom input element for auto completing tags
https://github.com/diversen/auto-complete-tags

auto-complete auto-complete-tags javascript

Last synced: 7 days ago
JSON representation

Custom input element for auto completing tags

Awesome Lists containing this project

README

        

# Auto complete tags

A custom web component that will fetch `tag` suggestions from an endpoint:

~~~html



import {AutoCompleteTags} from 'https://unpkg.com/[email protected]/index.js';
customElements.define('auto-complete-tags', AutoCompleteTags);

~~~

## Options

`data-wait` specifies how many milli-seconds to wait before fetching data from the endpoint

`data-url` is the endpoint. This should return a JSON array which will build the dropdown selection list.

Your current keyboard typings will be added to the `data-url` and sent to the endpoint

`data-complete-keys` is the keys that will auto-complete the selection. `ArrowUp` and `ArrowDown` are used for moving up and down.

## Styling

It is an open element, not using shadow-DOM, so you can style it from the outside. Just use a stylesheet.

## Demo

See: [index.html](index.html)

You can see the demo here [https://diversen.github.io/auto-complete-tags/](https://diversen.github.io/auto-complete-tags/)

## License

MIT © [Dennis Iversen](https://github.com/diversen)