Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

auto-complete-textbox

anandprajapati126MIT1.0.6TypeScript support: included

Standalone web component with autocomplete feature. Please see homepage for more info.

web-component, auto-complete-textbox

readme

auto-complete-textbox

It is a web component which gives you suggestion as soon as you start typing in. Default suggestion items are ["lorem", "ipsum", "dolor", "sit", "amet"]

How to use

To use this component in your project, you have to simply follow these steps:

  • Run npm install auto-complete-textbox
  • Put a script tag similar to this <script src='node_modules/auto-complete-textbox/autocompletetextbox.js'></script> in the head of your index.html
  • Then you can use the element anywhere in your html, template, JSX file etc using following custom tag:
    <body>
      <auto-complete-textbox></auto-complete-textbox>
    </body>
    `

Properties

Property Attribute Description Type Default
data -- The filterd data as per searched query string[] []
isDisabled disabled This property can be used by host element to make functionality disabled boolean false

Methods

addData(d: string[]) => Promise<void>

This method can be used to add new options to autocomplete suggestions list.

Returns

Type: Promise<void>

initializeData(d: string[]) => Promise<void>

This method can be used to change/initialize autocomplete suggestions list. Note - This will not append but reinitialize the suggestion data, so previous suggestion data will be overwritten.

Returns

Type: Promise<void>


Built with StencilJS