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

@gijsroge/iconify-search

v0.2.0

Published

Renderless component for Iconify icon search. Build custom UIs with search state, grouping, and selection via render props.

Readme

A renderless React component for searching Iconify icons. You get the search state, grouping, and selection logic—you build the UI (dialog, dropdown, inline list, etc.).

Want a ready-to-use component (button + dialog) with shadcn/ui? Use the iconify-search-component repo and add the block via the shadcn registry—it uses this package under the hood.

Installation

npm install @gijsroge/iconify-search

Peer dependencies (install them if you don’t already have them):

npm install react @tanstack/react-query @tanstack/react-pacer

Quick example

import { IconifySearchPrimitive } from "@gijsroge/iconify-search";

function MyIconPicker() {
  return (
    <IconifySearchPrimitive debounceMs={300} multiple={false}>
      {(state) => (
        <>
          <input
            placeholder="Search icons..."
            value={state.query}
            onChange={(e) => state.setQuery(e.target.value)}
          />
          {state.isPending && <span>Searching...</span>}
          {state.groups.map(({ prefix, name, icons }) => (
            <div key={prefix}>
              <h3>{name}</h3>
              <div className="icon-grid">
                {icons.map((iconId) => (
                  <button
                    key={iconId}
                    onClick={() => state.selectIcon(iconId)}
                    aria-pressed={state.selectedIcons.includes(iconId)}
                  >
                    <img
                      src={state.getIconUrl(iconId, 24)}
                      alt={iconId}
                      width={24}
                      height={24}
                    />
                  </button>
                ))}
              </div>
            </div>
          ))}
        </>
      )}
    </IconifySearchPrimitive>
  );
}

API

IconifySearchPrimitive

| Prop | Type | Default | Description | | ------------ | ---------------------- | ------- | ---------------------------------------------------------- | | multiple | boolean | false | Allow selecting multiple icons. When false, max one. | | debounceMs | number | 300 | Debounce delay (ms) before calling the Iconify search API. | | children | (state) => ReactNode | — | Render prop receiving the search state. |

State (IconifySearchState)

| Property | Type | Description | | ------------------ | ------------------------------------------- | --------------------------------------------------------- | | query | string | Current input value. | | setQuery | (value: string) => void | Update the search query. | | debouncedQuery | string | Query used for API calls (debounced). | | isPending | boolean | true while debouncing or fetching. | | data | IconifySearchResponse \| undefined | Raw API response. | | groups | Array<{ prefix, name, icons }> | Icons grouped by collection. | | selectedIcons | string[] | Selected icon IDs (e.g. ["mdi:home", "lucide:search"]). | | setSelectedIcons | (ids: string[]) => void | Set selection (respects multiple). | | selectIcon | (iconId: string) => void | Toggle (multiple) or set (single) selection. | | getIconUrl | (iconId: string, size?: number) => string | Iconify CDN URL for an icon. | | multiple | boolean | Same as the prop. |

Hooks and utilities

  • useIconifySearchAll(query) — React Query hook that fetches search results for a given (debounced) query. Use this if you want to wire the API yourself instead of using the primitive.
  • searchIcons(query, { limit?, start? }) — Fetches from the Iconify search API. Returns a promise of IconifySearchResponse.
  • getIconUrl(iconId, size?) — Returns the Iconify CDN URL for an icon ID (e.g. "mdi:home").

License

MIT