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 🙏

© 2025 – Pkg Stats / Ryan Hefner

custom-select-react

v1.0.7

Published

The `MultiSelectDropdown` is a highly customizable React component that allows users to select multiple items from a dropdown list. It supports search functionality, custom styling, and a variety of configuration options.

Downloads

39

Readme

MultiSelectDropdown Component

The MultiSelectDropdown is a highly customizable React component that allows users to select multiple items from a dropdown list. It supports search functionality, custom styling, and a variety of configuration options.

Features

  • Multi-Selection: Allows users to select multiple items.
  • Search Functionality: Includes a search input field to filter items.
  • Select All Option: Option to select all items at once.
  • Customizable Placeholder Text: Customizable text for the placeholder and "Select All" option.
  • Customizable Styles: You can customize the component’s styles by passing custom class names.
  • Single-Selection Mode: Switch between multi-selection and single-selection modes.
  • Click Outside to Close: The dropdown automatically closes when you click outside the component.
  • Dynamic Rendering: Supports dynamic rendering of selected items with a counter for overflow.

Props

Required Props

  • items: An array of items to be displayed in the dropdown. Each item can either be a string or an object with name and value properties.
    • Example: ['Item 1', 'Item 2'] or [{ name: 'Item 1', value: 'item1' }, { name: 'Item 2', value: 'item2' }].

Optional Props

  • maxVisibleItems: Number of items to show in the dropdown before showing a counter. Default is 1.

  • onSelectionChange: Callback function that gets called whenever the selected items change. It receives an array of selected item values.

  • selectedValues: Send Array of Values to show default selected items.

  • isMulti: Boolean to toggle between multi-selection and single-selection. Default is true.

  • customClassNames: Object to pass custom class names for styling. You can override the default class names for various parts of the component.

    • Example: { container: 'my-container', button: 'my-button' }.

    Customizable Styles

    You can customize the following styles by passing appropriate class names in the customClassNames prop:

    • container: The outermost container of the dropdown.
    • button: The button used to open the dropdown.
    • placeholder: The placeholder text inside the dropdown when no items are selected.
    • selectedItems: The container for the selected items in the dropdown.
    • selectedItem: The individual selected item in the dropdown.
    • closeIcon: The close icon (usually an "X" or similar) to remove a selected item.
    • itemCount: The counter that appears when there are more selected items than visible.
    • caret: The caret (arrow) icon that indicates the dropdown is open or closed.
    • caretOpen: The caret icon when the dropdown is open.
    • dropdownList: The list of items displayed in the dropdown.
    • searchBar: The container for the search input field.
    • searchInput: The actual input field for searching items.
    • dropdownItem: The individual item in the dropdown list.
    • label: The label for the dropdown.
    • singleSelectItem: The item selected in single-selection mode.
  • placeholderText: Customizable placeholder text for the dropdown when no items are selected. Default is 'Select items'.

  • selectAllText: Customizable text for the "Select All" checkbox. Default is 'Select All'.

  • searchPlaceholderText: Customizable placeholder text for the search input. Default is 'Search...'.

Installation

To install the component in your React project:

npm install custom-select-react