New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

multi-nested-select

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

multi-nested-select

multi-nested-select package

  • 1.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
40
decreased by-28.57%
Maintainers
1
Weekly downloads
 
Created
Source

REACT MULTI-NESTED-SELECT DROPDOWN

npm License npm bundle size npm Libraries.io dependency status for latest release

💥💥💥 React Library for SCREEN RECORDER . Tiny and Efficient. Check it Out 💥💥💥

Description

A React component which provides multi select functionality for nested option list of continent -> country -> state with various features like selection limit, CSS customization, checkbox, search option, disable preselected values, control nested level keyboard navigation for accessibility, chip select, delete selected, limit chip count, leading and trailing icon for search box, placeholder context and grouping features. Also it has feature to behave like normal dropdown(means single select dropdown).

🎉🎉 New features in >=1.1.7

✨ Easy to use
🍃 Light weight
🚀 Typescript

🏳️‍🌈 Getting Started

1. Installation 🔧

npm install multi-nested-select

yarn add multi-nested-select

2. Demo 👁️

React-multi-nested-select-dropdown


3. Basic Usage 📑

import NestedSelect from "multi-nested-select";;


callbackFunction(selectedItem) {
    ...
}

onChange(e_selected) {
    ...
}

<NestedSelect
    buttonContent="Done" // For custom text for button
    enableButton={true}  // To show or hide the button 
    state={true}         // show the nested level state 
    continent={true}     // show and hide the continent 
    chip={true}          // show and hide the chip 
    onChange={(val) => onChange(val)}  // while adding/removing this onchange will call
    callback={(val) => callbackFunction(val)}  //on submit or save button callback()
/>




4. Props 💬

PropTypeDefaultDescription
callbackfunction(val) => {}Callback function will invoked on click of save button
onSearchfunction(val) => {}Callback function will invoked on change of input feild event (similar to onChange). Params are searchValue
onChangefunction(val) => {}Callback function will invoked on selection or removal of options. Params are selectedList.
onViewmorefunction(val) => {}Callback function will invoked on click on view more (only when chip is true).
onChipDeletefunction(val) => {}Callback function will invoked on deletion of chip. (only when chip is true).
disabledbooleanfalseMake it true to disable the select input feild.
selectedValuearray[]Default value to persist in dropdown
showCustomListarray[]Dropdown array list according to showCustomList.
errorboolfalseTo display error on input field.
helperTextstring""To display the helper text for input.
expandChipbooltrueTo display chip expand and collapse option
showCheckboxbooltrueTo display checkbox option in the dropdown
omitSelectedboolfalseTo unselect the selected when clicked outside of dropdown.
selectLimitnumber-1You can limit the number of items that can be selected in a dropdown
placeholderstringSelect AreaPlaceholder text
buttonContentstringSave SelectedTo display the button text content`
disableboolfalseto disaled / enabled the button
selectAllOptionboolfalseto enable "All regions" select option to select in one go
widthnumber360width of the component.
heightnumber260height of the dropdown.
chipboolfalseview selected option as chip.
chipCountnumber5chip count displayed on input.
placeholderCtxbooltrueenabale/ disable placeholderctx after option select.
enableButtonbooltrueMake it false to hide the button.
trailingbooltrueMake it false to hide the trailing message ex- 0 of 24 selected'.
leadingbooltrueMake it false to hide the leading icon in search box'.
trailingIconbooltrueMake it false to hide the trailing icon in search box'.
statebooltrueOption to show or hide the state option list .make it false to hide state list.
continentbooltrueOption to show or hide the continent option list .make it false to hide continent list.
idstring''Id for the search container / input field..
buttonClassstring''styling for the save button(this is className).
dropDownClassstring''styling for the dropdown(this is className).
inputClassstring''styling for the input field wrapper with trailing icon or leading icons(this is className).
styleobject{}CSS Customization for multi-nested-select input fields.
...propsattribute''pass any attribute other than above listed, it will default assigned to input feild as their own attributes.

5. CSS Customization 🌈

For customization of CSS we have provide className based support 

* For input box -- 
Pass props as inputClass= " ... your class name... "
<SelectCountry 
  inputClass="myCustom_text"
/>


* For drop-Down box -- 
Pass props as dropDownClass= "... your class name... "
<SelectCountry 
  dropDownClass="myCustom_dropbox"
/>

* For drop-Down box -- 
Pass props as dropDownClass= "... your class name... "
<SelectCountry 
  buttonClass="myCustom_button"
/>

Now create your own .css or .scss file to define that class style according to your need.

Ex -

Create `custom.css` file in your repo


.myCustom_dropbox{
    height: 200px;
    z-index: 1000;
}


8. Licence 📜

MIT

9. Development

This package is build with typescript, react js and webpack .

10. Contributions

Contributions are welcome, please open an issue and preferrably file a pull request.

Opening Issue Please share sample code using codesandbox.com or stackblitz.com to help me re-produce the issue.

11. Playground

https://codesandbox.io/s/multi-select-nested-options-5eyyu4?file=/src/App.js

Keywords

FAQs

Package last updated on 11 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc