0.2.4 • Published 5 years ago

nega-autocomplete v0.2.4

Weekly downloads
12
License
ISC
Repository
github
Last release
5 years ago

\<nega-autocomplete>

Published on webcomponents.org

A simple autocomplete web component.

See: Documentation, Demo.

Usage

Installation

npm install --save nega-autocomplete

In an html file

<html>
  <head>
    <script type="module">
      import 'nega-autocomplete/nega-autocomplete.js';
    </script>
  </head>
  <body>
    <nega-autocomplete items="[&quot;dog&quot;,&quot;cat&quot;,&quot;bird&quot;,&quot;fish&quot;,&quot;rabbit&quot;,&quot;fox&quot;,&quot;bear&quot;]">
      <input type="text" placeholder="Animals" />
    </nega-autocomplete>
  </body>
</html>

In a Polymer 3 element

import {PolymerElement, html} from '@polymer/polymer';
import 'nega-autocomplete/nega-autocomplete.js';

class SampleElement extends PolymerElement {
  static get template() {
    return html`
      <nega-autocomplete .items=[[items]]>
        <input type="text" placeholder="Animals" />
      </nega-autocomplete>
    `;
  }

  static get properties() {
    return {
      items: {type: Array, value: ['dog', 'cat', 'bird', 'fish', 'rabbit', 'fox', 'bear']}
    }
  }
}
customElements.define('sample-element', SampleElement);

Contributing

Feel free to fork and send over PRs. Still a lot of places this can be improved, i.e. styling, more options, or better behaviors.

Installation

git clone https://github.com/kennethklee/nega-autocomplete
cd nega-autocomplete
npm install

Running locally

$ npm start

Running tests

$ npm test
0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago