An input element that sends its value to a server endpoint and renders the response body.
npm install @github/remote-input-elementAn input element that sends its value to a server endpoint and renders the response body.
```
$ npm install @github/remote-input-element
`js`
import '@github/remote-input-element'
`html`
A GET request will be sent to /query?q=${input.value}.
The parameter name (q) is customizable with the [param] attribute:
`html`
A boolean [loading] attribute is added to when a network request begins and removed when it ends.
`css`
.loading-icon { display: none; }
remote-input[loading] .loading-icon { display: inline; }
- loadstart - The server fetch has started.load
- - The network request completed successfully.error
- - The network request failed.loadend
- - The network request has completed.remote-input-success
- – Received a successful response (status code 200-299), and response HTML has been set. Bubbles.remote-input-error
- – Received a not successful response. Bubbles.
Browsers without native [custom element support][support] require a [polyfill][].
- Chrome
- Firefox
- Safari
- Microsoft Edge
[support]: https://caniuse.com/#feat=custom-elementsv1
[polyfill]: https://github.com/webcomponents/custom-elements
```
npm install
npm test
Distributed under the MIT license. See LICENSE for details.