
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
multiselect-react-dropdown
Advanced tools
React multiselect dropdown component with search and various features
A React component which provides multi select functionality with various features like selection limit, CSS customization, checkbox, search option, disable preselected values, flat array, keyboard navigation for accessibility and grouping features. Also it has feature to behave like normal dropdown(means single select dropdown).
npm install multiselect-react-dropdown
import { Multiselect } from 'multiselect-react-dropdown';
this.state = {
options: [{name: 'Srigar', id: 1},{name: 'Sam', id: 2}]
};
<Multiselect
options={this.state.options} // Options to display in the dropdown
selectedvalues={this.state.selectedValue} // Preselected value to persist in dropdown
onSelect={this.onSelect} // Function will trigger on select event
onRemove={this.onRemove} // Function will trigger on remove event
displayValue="name" // Property name to display in the dropdown options
/>
onSelect(optionsList, selectedItem) {
...
}
onRemove(optionList, removedItem) {
...
}
Prop | Type | Default | Description |
---|---|---|---|
options | array | [] | Dropdown options |
onSelect | function | func | Callback function will invoked on select event. Params are selectedList & selectedItem |
onRemove | function | func | Callback function will invoked on remove event. Params are selectedList & removedItem |
singleSelect | boolean | false | Make it true to behave like a normal dropdown(single select dropdown) |
selectedValues | array | [] | Preselected value to persist in dropdown |
showCheckbox | bool | false | To display checkbox option in the dropdown |
selectionLimit | number | -1 | You can limit the number of items that can be selected in a dropdown |
placeholder | string | Select | Placeholder text |
disablePreSelectedValues | bool | false | Prevent to deselect the preselected values |
isObject | bool | true | Make it false to display flat array of string or number Ex. ['Test1',1] |
displayValue | string | value | Property name in the object to display in the dropdown. Refer Basic Usage section |
emptyRecordMsg | string | No options available | Message to display when no records found |
groupBy | string | '' | Group the popup list items with the corresponding category by the property name in the object |
closeIcon | string | circle | Option to select close icon instead of default. Refer Close Icon section |
style | object | {} | CSS Customization for multiselect. Refer below object for css customization. |
caseSensitiveSearch | bool | false | Enables case sensitivity on the search field. |
id | string | '' | Id for the input field. |
{
multiselectContainer: { // To change css for multiselect (Width,height,etc..)
....
},
searchBox: { // To change search box element look
border: none;
font-size: 10px;
min-height: 50px;
},
inputField: { // To change input field position or margin
margin: 5px;
},
chips: { // To change css chips(Selected options)
background: red;
},
optionContainer: { // To change css for option container
border: 2px solid;
}
option: { // To change css for dropdown options
color: blue;
},
groupHeading: { // To chanage group heading style
....
}
}
Name | Image |
---|---|
circle | ![]() |
circle2 | ![]() |
cancel | ![]() |
close | ![]() |
MIT
FAQs
React multiselect dropdown component with search and various features
The npm package multiselect-react-dropdown receives a total of 31,089 weekly downloads. As such, multiselect-react-dropdown popularity was classified as popular.
We found that multiselect-react-dropdown demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.