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

toey-react-dropdown

v1.1.10

Published

library for react dropdown

Readme

react-searchable-dropdown 1.0.5

How to install

# NPM
npm i the-ultimate-and-the-best-react-searchable-dropdown

#YARN
yarn add the-ultimate-and-the-best-react-searchable-dropdown

Story Book Demo

https://613c0ae26a019e003a9d89ed-hpjlfbrniz.chromatic.com/

Component Info

There are MultipleSelector and Selector dropdown component, both are handle long list of choices by using lib react-window (https://github.com/bvaughn/react-window) and using style and component from material-ui (https://material-ui.com/)

Selector Info

Selector Special Type

| type name | type | Description | | --- | --- | --- | | Choice | { label: string; used?: boolean; description?: string; [key: string]: any; } | choice object that we provide to the selector, choice must have label and you can add any arbitary attribute to it so it will return when the choice is selected, description is a string showing on choice tooltip | | ChoiceSection | { choices: Choice[]; sectionName?: string; sectionPrefix?: any; } | contain section name, section prefix and choices of that section | | SearchTextFieldProps | TextFieldProps (from material-ui)| search textfield props type, it is exported from Selector component | | SearchTextFieldInputProps | Partial<InputProps> | Partial<FilledInputProps> | Partial<OutlinedInputProps> (all from material-ui)| search textfield input props type, it is exported from Selector component |

Selector Required Props

| name | type | Description | | --- | --- | --- | | label | string | string label showing on selector div | | popUpKey | string | key for selector popup element | | choiceSections | ChoiceSection[] | key for selector popup element | | handleSelect | ({ value, name }: { value: Choice, name: string }) => void | handle function, trigger when a choice is selected |

Selector Optional Props

| name | type | Description | | --- | --- | --- | | itemHeight | number | height of item inside popup (for react-window component) | | scrollDivHeight | number | height of popup scroll div (for react-window component) | | style | CSSProperties | HTML style props for top div component that have every other component inside | | selectDivPropsStyle | CSSProperties | HTML style props for button component that handle click event | | className | string | className for button component that handle click event | | labelPrefix | string | string that will show on the left side of the selector label | | name | string | name of the selector that will also provide to handleSelect function | | placeholder | string | placeholder will show when label is null, undefined or empty string | | id | string | id for selector that will provide to all inside component | | tooltip | string | string that will show on selector tooltip | | topDivClassName | string | className props for top div component that have every other component inside | | popupClassName | string | selector popup className props | | sectionNameClassName | string | popup section name component className props | | itemClassName | string | item className props | | disablePortal | boolean | for disable popup portal | | error | boolean | if error selector will have red border | | disable | boolean | for disable the selector | | disableDropDownArrow | boolean | for hiding arror | | dropDownArrowClassName | string | arrow component className | | dropDownArrowComponent | React.ReactNode | for custom dropdown arrow | | searchTextfieldProps | SearchTextFieldProps | props object for search textfield | | searchTextFieldInputProps | SearchTextFieldInputProps | input props object for search textfield |

Multiple Selector Info

Multiple Selector Special Type

| type name | type | Description | | --- | --- | --- | | Choice | { label: string; used?: boolean; checked?: boolean; singleChoice?: boolean; id?: string; [key: string]: any; } | choice object that we provide to the selector, choice must have label and you can add any arbitary attribute to it so it will return when the choice is selected, if singleChoice is true handleSelect will trigger when click on this choice | | ChoiceSection | { choices: Choice[]; sectionName?: string; sectionPrefix?: any; } | contain section name, section prefix and choices of that section | | SearchTextFieldProps | TextFieldProps (from material-ui)| search textfield props type, it is exported from Selector component | | SearchTextFieldInputProps | Partial<InputProps> | Partial<FilledInputProps> | Partial<OutlinedInputProps> (all from material-ui)| search textfield input props type, it is exported from Selector component |

Multiple Selector Required Props

| name | type | Description | | --- | --- | --- | | label | string | string label showing on selector div | | popUpKey | string | key for selector popup element | | choiceSections | ChoiceSection[] | key for selector popup element | | handleSelect | ({ value, name }: { value: Choice[], name: string }) => void | handle function, trigger when a sigleChoice choice is click or popup is close |

Multiple Selector Optional Props

| name | type | Description | | --- | --- | --- | | itemHeight | number | height of item inside popup (for react-window component) | | scrollDivHeight | number | height of popup scroll div (for react-window component) | | style | CSSProperties | HTML style props for top div component that have every other component inside | | selectDivPropsStyle | CSSProperties | HTML style props for button component that handle click event | | className | string | className for button component that handle click event | | labelPrefix | string | string that will show on the left side of the selector label | | name | string | name of the selector that will also provide to handleSelect function | | placeholder | string | placeholder will show when label is null, undefined or empty string | | id | string | id for selector that will provide to all inside component | | tooltip | string | string that will show on selector tooltip | | topDivClassName | string | className props for top div component that have every other component inside | | popupClassName | string | selector popup className props | | sectionNameClassName | string | popup section name component className props | | itemClassName | string | item className props | | checkedChoices | Choice[] | lish that contain all check choice, if provide choices that are in checkedChoices will be checked when open popup | | error | boolean | if error selector will have red border | | disable | boolean | for disable the selector | | disableDropDownArrow | boolean | for hiding arror | | dropDownArrowClassName | string | arrow component className | | dropDownArrowComponent | React.ReactNode | for custom dropdown arrow | | searchTextfieldProps | SearchTextFieldProps | props object for search textfield | | searchTextFieldInputProps | SearchTextFieldInputProps | input props object for search textfield |