esm.sh CDN sanity check

This page loads the component class from esm.sh and registers it manually. The package is not published yet; until then, the original list remains available without filter controls. Read the README.

Import and register the class

<script type="module">
  import { ListFilterElement } from
    'https://esm.sh/@aarongustafson/list-filter@1.0.0/list-filter.js?bundle&target=es2022';

  if (!customElements.get('list-filter')) {
    customElements.define('list-filter', ListFilterElement);
  }
</script>

<list-filter for="drinks" search></list-filter>
<ul id="drinks">
  <li>Lemon tea</li>
  <li>Sparkling water</li>
</ul>
  • Lemon tea
  • Sparkling water