- fix: output umd build for main key #19
Assets
2
- Remove
text/html; fragmentfrom accept header (#22)
Assets
2
- Accept
text/fragment+htmlas a content-type (#21)
Assets
2
- Fixed parsing for relative URL in
src#13
Assets
2
Assets
2
Assets
2
<remote-input> element
An input element that sends its value to a server endpoint and renders the response body.
Installation
$ npm install @github/remote-input-element
Usage
import '@github/remote-input-element'<!-- Filter a list of items from the server -->
<remote-input src="/query" aria-owns="results">
<input>
</remote-input>
<ul id="results"></ul>A GET request will be sent to /query?q=${input.value}.
The parameter name (q) is customizable with the [param] attribute:
<!-- Live preview of Markdown -->
<remote-input src="/preview" aria-owns="md-preview" param="body">
<textarea></textarea>
</remote-input>
<div id="md-preview"></div>Styling loading state
A boolean [loading] attribute is added to <remote-input> when a network request begins and removed when it ends.
.loading-icon { display: none; }
remote-input[loading] .loading-icon { display: inline; }Events
const remoteInput = document.querySelector('remote-input')
// Network request lifecycle events.
remoteInput.addEventListener('loadstart', function(event) {
console.log('Network request started', event)
})
remoteInput.addEventListener('loadend', function(event) {
console.log('Network request complete', event)
})
remoteInput.addEventListener('load', function(event) {
console.log('Network request succeeded', event)
})
remoteInput.addEventListener('error', function(event) {
console.log('Network request failed', event)
})Browser support
Browsers without native custom element support require a polyfill.
- Chrome
- Firefox
- Safari
- Microsoft Edge
Development
npm install
npm test
License
Distributed under the MIT license. See LICENSE for details.

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
