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

@cocorof/react-selector

v0.1.3

Published

Dependency-free React select — one component for both a fixed list and a searchable one, with async loading, multi-select, groups, keyboard and a11y, themable with CSS variables

Readme

@cocorof/react-selector

One React select for both cases, with no runtime dependencies.

A status filter with five fixed options does not need a search box — a text input above five items is noise. A list of every user in an org is unusable without one. Most select libraries make you choose a different component for each; this one decides from the list it was given, and you can override it.

npm i @cocorof/react-selector
import { Selector } from "@cocorof/react-selector";
import "@cocorof/react-selector/styles.css";

// short, fixed → no search box
<Selector value={status} onChange={setStatus} options={[
  { value: "new", label: "New", count: 12 },
  { value: "read", label: "Read" },
]} />

// long → the search box appears on its own
<Selector value={userId} onChange={setUserId} options={users} />

// remote → you answer the query; the component stops filtering locally
<Selector value={userId} onChange={setUserId} options={results}
          onSearch={setQuery} loading={isFetching} />

Why it behaves the way it does

  • The search box appears at 8 options (searchThreshold), or whenever onSearch is given. Force it either way with searchable.
  • onSearch turns off local filtering. Whoever answers the query owns the result; filtering it again client-side would hide rows the server deliberately returned.
  • Multi-select stays open. A menu that closes after each pick is a fight.
  • Initials match, but narrowly. cmo finds "Chief Marketing Officer"; user 12 does not match "User 21", because a subsequence rule applied to long queries lies.
  • The menu is position: fixed. An absolutely positioned menu inherits every overflow: hidden between it and the page, which is how dropdowns end up clipped inside cards. It flips above the trigger when the viewport would cut it off.

Props

| prop | type | note | |---|---|---| | value | string \| string[] \| null | array with multiple | | onChange | (value) => void | string, or string[] with multiple | | options | SelectorOption[] \| SelectorGroup[] | groups render with headers | | searchable | boolean | override the automatic decision | | searchThreshold | number | default 8 | | onSearch | (q: string) => void | remote mode | | loading | boolean | shows a loading row | | multiple clearable disabled | boolean | | | size | "sm" \| "md" \| "lg" | 32 / 36 / 40px | | labels | SelectorLabels | every string is replaceable | | renderValue | (selected) => ReactNode | custom trigger content |

SelectorOption: { value, label, keywords?, icon?, count?, description?, disabled? }. keywords is what search matches when label is not a string.

Theming

Every colour is a CSS variable on .rsel; there is no styling to override.

.rsel { --rsel-accent: #7c3aed; --rsel-radius: 8px; }

Light and dark follow prefers-color-scheme. Pin one with data-rsel-theme="light" | "dark".

Keyboard and a11y

combobox trigger, listbox menu, option rows with aria-selected. Arrows move, Home/End jump, Enter picks, Escape closes and returns focus, Tab closes.

MIT