npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

html-combobox-element

v0.0.4

Published

The combo-box web-component & customizable select polyfill

Readme

html-combobox-element

The <combo-box> is a web component that provides dropdown/combobox functionality through <select> fully compatible API.

Install

npm install html-combobox-element
// app entry point
import 'html-combobox-element';

This registers the <combo-box>, <box-option> and <box-tag> custom elements with full TS support for plain DOM/vanilla-JS usage.

TypeScript + JSX

Using <combo-box> in JSX or a Vue template needs one extra step, due to a TypeScript limitation: JSX/template type-checking only picks up custom element typings from a file in your own project - not from a package's shipped .d.ts.

This isn't specific to this package; it affects any library adding custom elements to JSX.IntrinsicElements under the modern automatic JSX runtime.

So, in addition to import 'html-combobox-element', create and include one small file tsconfig.json, with the snippet for your framework:

// combo-box.d.ts
declare module 'react/jsx-runtime' {
  namespace JSX {
    interface IntrinsicElements {
      'combo-box': ComboboxElementAttributes;
      'box-option': ComboboxOptionElementAttributes;
      'box-tag': ComboboxTagElementAttributes;
    }
  }
}
declare module 'react/jsx-dev-runtime' {
  namespace JSX {
    interface IntrinsicElements {
      'combo-box': ComboboxElementAttributes;
      'box-option': ComboboxOptionElementAttributes;
      'box-tag': ComboboxTagElementAttributes;
    }
  }
}
// combo-box.d.ts
declare module 'preact/jsx-runtime' {
  namespace JSX {
    interface IntrinsicElements {
      'combo-box': ComboboxElementAttributes;
      'box-option': ComboboxOptionElementAttributes;
      'box-tag': ComboboxTagElementAttributes;
    }
  }
}
// combo-box.d.ts
declare module 'solid-js/jsx-runtime' {
  namespace JSX {
    interface IntrinsicElements {
      'combo-box': ComboboxElementAttributes;
      'box-option': ComboboxOptionElementAttributes;
      'box-tag': ComboboxTagElementAttributes;
    }
  }
}

Vue templates aren't JSX, so they're type-checked through GlobalComponents instead:

// combo-box.d.ts
declare module 'vue' {
  export interface GlobalComponents {
    'combo-box': new () => { $props: ComboboxElementAttributes };
    'box-option': new () => { $props: ComboboxOptionElementAttributes };
  }
}

This checks required props and value types for props you pass; like any native custom element, Vue still allows extra/unrecognized attributes through (that's expected Vue behavior for custom elements, not a gap in this typing). The trailing export {}; may be required here (without it the file is treated as a script, not a module, and the augmentation breaks Vue's own types).

Exported types

  • HTMLComboboxElement, HTMLComboboxOptionElement, HTMLComboboxTagElement - element interfaces, also usable via document.querySelector('combo-box') etc.
  • ComboboxEvent, ComboboxInputEvent, ComboboxFocusEvent - typed event objects (event.target is a properly typed HTMLComboboxElement).
  • ComboboxJsxAttributes, ComboboxOptionJsxAttributes - the component's own props (value, multiple, placeholder, clearable, searchable, filterable, required, disabled, etc.), framework-independent.
  • ComboboxElementAttributes, ComboboxOptionElementAttributes, ComboboxTagElementAttributes - the above plus common passthrough attributes (class/className, style, ref, children, data-*, aria-*, on*). These are what the snippets above use for 'combo-box' / 'box-option' / 'box-tag'.