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

@md-plugins/search-ui

v2.1.0

Published

Framework-agnostic search UI and static search provider for md-plugins documentation search indexes.

Readme

@md-plugins/search-ui

npm version npm downloads npm monthly downloads license

Discord X

Framework-agnostic search UI for search indexes generated by @md-plugins/vite-search-plugin. Q-Press uses it for header search, and non-Q-Press sites can use the same Web Component against a generated JSON index or a custom provider.

The package provides:

  • a static JSON search provider for search/search-index.json
  • normalized search result types
  • the <md-search> Web Component
  • CSS custom properties and part attributes for site-specific styling
  • an icon-only mobile trigger that keeps search available in narrow headers

Installation

pnpm add @md-plugins/search-ui

Static JSON Usage

import { defineMdSearchElement } from '@md-plugins/search-ui'

defineMdSearchElement()
<md-search src="/search/search-index.json"></md-search>

Search results collapse duplicate records by default. This keeps generated heading/content pairs that point to the same URL from appearing twice in the panel. Add show-duplicate-results when you want to inspect the raw index output:

<md-search src="/search/search-index.json" show-duplicate-results></md-search>

Styling

The component uses Shadow DOM, CSS custom properties, and part attributes:

md-search {
  --md-search-accent: #1976d2;
  --md-search-surface: white;
  --md-search-text: #102033;
  --md-search-radius: 14px;
}

md-search::part(dialog) {
  box-shadow: 0 24px 80px rgb(0 0 0 / 24%);
}

The component supports light and dark modes. By default it follows prefers-color-scheme. Use the theme attribute when your application owns the active theme:

<md-search src="/search/search-index.json" theme="dark"></md-search>

Use theme="light" to force light mode. Site CSS variables can still override either theme.

Accessibility

<md-search> includes keyboard and screen-reader support:

  • Ctrl+K / Cmd+K opens the search by default.
  • Escape closes the dialog.
  • ArrowUp and ArrowDown move between results.
  • Enter selects the active result.
  • The dialog uses role="dialog" and aria-modal.
  • The input exposes combobox/listbox relationships through ARIA attributes.
  • Result rows use role="option" and update the active descendant.

Use search-label to provide a project-specific input label:

<md-search src="/search/search-index.json" search-label="Search product documentation"></md-search>

Custom Providers

import { createSearch } from '@md-plugins/search-ui'

createSearch({
  target: document.querySelector('#search')!,
  provider: {
    async search(query) {
      return mySearchService(query)
    },
  },
})