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

react-multiselect

v0.4.1

Published

A client-side React component that presents the user with a list of items and allows them to filter and select one or more of them.

Readme

Please get in touch with me if you have any issues or suggestions for this project. It's under active development and I'm taking requests for new features or bug fixes. You can contact me via e-mail at [email protected].

React-MultiSelect

React-MultiSelect is a client-side React component that presents the user with a list of items and allows them to filter and select one or more of them.

React-MultiSelect Example

Features

Filters

Enter some text in the input box to filter the items listed. Selections are remembered even if the items are momentarily not visible.

Dynamic Data

Supports loading item lists dynamically with AJAX requests. Selections will remain across requests as long as the item ids stay the same. This can be helpful where you need the items in one multiselect to depend on the selections in another multiselect and want them to update dynamically.

Examples

Some examples are included with the project. You can run them locally using nodejs to serve the files.

Run the following commands in the project directory, and then navigate to the URL displayed.

$ sudo npm install http-server -g
$ http-server

Options

The options below can be passed to the React-MultiSelect component to customize its behavior.

JSX

/** @jsx React.DOM */
<MultiSelect
  items={[]}
  placeholder={''}
  onChange={function(selections) {}}
  onItemSelected={function(item) {}}
  onItemDeselected={function(item) {}}
/>

JavaScript

React.renderComponent(
  MultiSelect({
    items: {},
    placeholder: '',
    onChange: function(selections) {},
    onItemSelected: function(item) {},
    onItemDeselected: function(item) {}
  }), document.getElementById('multiselect'))
)

items

Items to display in the list. Each item must contain an id property to identify the item and a text property to display in the item list.

placeholder

Text to initially display in the filter input box. Defaults to an empty string.

onChange(selections)

Called after items are selected or deselected. The parameter is an object where the keys are item ids and the values are true or false to indicate whether or not an item is selected. Use this event when you need a summary of changes and not individual selections or deselections as they occur.

onItemSelected(item)

Called whenever an item is selected. The parameter is the item. Use this when you want to capture selections as they occur.

onItemDeselected(item)

Corresponding event for onItemSelected that is called whenever an item is deselected.

CSS

You can use the following CSS selectors to customize the appearance of the component.

div.multiselect
div.multiselect input // Filter text
div.multiselect ul
div.multiselect li
div.multiselect li:hover
div.multiselect button
div.multiselect .selected // Style for a selected item
div.multiselect .deselected // Style for a deselected item

See example/basic.css to get started with styling.