Gathering detailed insights and metrics for mui-chip-select
Gathering detailed insights and metrics for mui-chip-select
A React component that helps you display selectable options with MUI chip.
npm install mui-chip-select
Typescript
Module System
Node Version
NPM Version
48.4
Supply Chain
79.8
Quality
74
Maintenance
100
Vulnerability
99.6
License
TypeScript (100%)
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
175,513
Last Day
1
Last Week
10
Last Month
35
Last Year
16,515
MIT License
17 Stars
3 Commits
2 Watchers
1 Branches
1 Contributors
Updated on Feb 25, 2024
Minified
Minified + Gzipped
Latest Version
1.0.1
Package Id
mui-chip-select@1.0.1
Unpacked Size
17.69 kB
Size
4.46 kB
File Count
15
NPM Version
8.19.2
Node Version
19.0.0
Published on
May 01, 2023
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
42.9%
10
Compared to previous week
Last Month
-31.4%
35
Compared to previous month
Last Year
-89.6%
16,515
Compared to previous year
1
A React component that helps you display selectable options with MUI chip.
npm install mui-chip-select
or
yarn add mui-chip-select
Add MuiChipSelect
to your component like this:
import React, { useState } from 'react';
import { MuiChipSelect } from 'mui-chip-select';
function App() {
const [selectedOptions, setSelectedOptions] = useState([]);
function handleSelectionChange(newSelection: any) {
setSelectedOptions(newSelection);
}
const customChipProps = {
sx: {
backgroundColor: 'orange'
},
};
const options = ['Mango', 'Orange', 'Carrot']
return (
<div className="App">
<p>Please select all that applies</>
<MuiChipSelect options={options} onChange={handleSelectionChange} chipProps={customChipProps }/>
</div>
);
}
export default App;
Options can also be an array of objects:
const options = [
{
label: "Mango",
value: 'd5b3dd96-6657-4e3f-82d1-1046d61c2f99'
},
{
label: "Orange",
value: '7ab12239-4b03-4898-bfed-a3de7d7e8c95'
},
{
label: "Carrot",
value: '0e822307-2054-4a4d-ad0f-18a652d5b3df'
}
];
Common props you may want to specify include:
Name | Type | Required | Description |
---|---|---|---|
options | Array of strings or objects | Yes | An array of options to be displayed as chips. Can be either an array of strings or an array of objects with label and value properties.. |
onChange | (selected: Option[]) => void | Yes | A callback function that gets triggered when an option is selected or unselected. The function receives an array of selected options as an argument |
chipProps | React.ComponentProps<typeof Chip> | No | Props to be passed to the Chip component.Can be used to customize the appearance and behavior of the chip container. |
className | string | No | A class name to be added to the Chip wrapper.Can be used to add custom CSS styles to the container. |
MIT Licensed. Copyright (c) Chiamaka Umeh 2023.
No vulnerabilities found.
No security vulnerabilities found.