Auto-complete input values from server results
npm install @github/auto-complete-elementAuto-complete input values from server search results.
```
$ npm install --save @github/auto-complete-element
Import as ES modules:
`js`
import '@github/auto-complete-element'
With a script tag:
`html
--> and comment out the script referencing the unpkg version. This allows you to use the src code in this repo. Otherwise, you will be pulling the latest published code, which will not reflect the local changes you are making.
We have included some custom rules that assist in providing guardrails to confirm this component is being used accessibly.
If you are using the axe-core library in your project,`js
import axe from 'axe-core'
import autoCompleteRulesBuilder from '@github/auto-complete-element/validator'
const autoCompleteRules = autoCompleteRulesBuilder() // optionally, pass in your app's custom rules object, it will build and return the full object
axe.configure(autoCompleteRules)
axe.run(document)
`
To confirm your usage is working as designed,
`js
import {validate} from '@github/auto-complete-element/validator'
validate(document)
`passes
Passes and failures may be determined by the length of the and violations arrays on the returned object:`js``
{
passes: [],
violations: []
}
Distributed under the MIT license. See LICENSE for details.