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

@asnewyla/select

v0.2.1

Published

Styled select/combobox with label, validation error display, and accessibility

Downloads

257

Readme

@asnewyla/select

Styled select/combobox built on @asnewyla/unstyled-select. Label association, inline validation error, client-side search/filter, and removable chips for multi-select — full keyboard/focus accessibility.

Install

npm install @asnewyla/select

Import the stylesheet once, anywhere in your app:

import '@asnewyla/select/styles.css';

Usage

import { Select } from '@asnewyla/select';

const fruitOptions = [
  { value: 'apple', label: 'Apple' },
  { value: 'banana', label: 'Banana' },
  { value: 'cherry', label: 'Cherry', disabled: true },
];

<Select
  label="Fruit"
  options={fruitOptions}
  placeholder="Choose a fruit"
/>

<Select
  label="Fruit"
  options={fruitOptions}
  error="Pick a fruit to continue"
/>

// Controlled
<Select
  label="Fruit"
  options={fruitOptions}
  value={selected}
  onChange={setSelected}
/>

// Multi-select — selected options render as removable chips
<Select
  label="Fruit"
  options={fruitOptions}
  multiple
  defaultValue={['apple', 'banana']}
  onChange={(values) => console.log(values)}
/>

Props

Everything @asnewyla/unstyled-select accepts, plus:

| Prop | Type | Default | |---|---|---| | label | string (required) | — | | error | string | — |

error doubles as the invalid-state flag — there's no separate invalid prop, and renderValue isn't exposed either (its multi-select chip rendering is what this package provides). Setting error sets aria-invalid/data-invalid on the trigger and links it via aria-describedby to the rendered error message. Same convention @asnewyla/input and @asnewyla/checkbox use.

Multi-select chips

Each selected option renders as a chip with its own remove button (aria-label="Remove <label>"). Removing a chip calls onChange with that option deselected — the same toggle clicking it again in the listbox would trigger. The listbox is still there for adding more options; chips are just an alternate way to see and remove what's already selected.

Single-select shows the selected label as plain text, unchanged from @asnewyla/unstyled-select's own default — chips are a multi-select-only affordance.

Theming

Override the CSS custom properties — defaults adapt automatically to prefers-color-scheme via @asnewyla/tokens:

:root {
  --xd-color-primary: #0d9488;
  --xd-color-destructive: #dc2626;
  --xd-color-surface: #ffffff;
}

Not yet supported

Inherits @asnewyla/unstyled-select's own limitations — see its README: no native FormData form participation, and the listbox popup renders inline (no portal), so it can be visually clipped by an overflow: hidden or scrolling ancestor.

License

MIT