Gathering detailed insights and metrics for @material/react-select
Gathering detailed insights and metrics for @material/react-select
Gathering detailed insights and metrics for @material/react-select
Gathering detailed insights and metrics for @material/react-select
react-select-material-ui
A react SELECT component based on react-select and looking like a material-ui component
react-material-select
React select with Material Design wrote in ES2015(ES6)
react-native-element-dropdown
React Native Element Dropdown is a library that provides a customizable dropdown component for React Native applications.
@appgeist/react-select-material-ui
An outlined Material-UI input component based on react-select
npm install @material/react-select
Typescript
Module System
Node Version
NPM Version
TypeScript (92.35%)
CSS (4.36%)
JavaScript (2.51%)
Shell (0.39%)
Dockerfile (0.26%)
HTML (0.13%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
2,023 Stars
471 Commits
231 Forks
62 Watchers
6 Branches
64 Contributors
Updated on May 29, 2025
Latest Version
0.15.0
Package Id
@material/react-select@0.15.0
Unpacked Size
445.59 kB
Size
82.92 kB
File Count
29
NPM Version
6.8.0
Node Version
10.13.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
MDC React Select is component for MDC Select. Please see MDC Select.
npm install @material/react-select
with Sass:
1import '@material/react-list/index.scss'; 2import '@material/react-menu-surface/index.scss'; 3import '@material/react-menu/index.scss'; 4import '@material/react-select/index.scss';
with CSS:
1import '@material/react-list/dist/menu.css'; 2import '@material/react-menu-surface/dist/menu.css'; 3import '@material/react-menu/dist/menu.css'; 4import '@material/react-select/dist/select.css';
React Select requires at least one <Option>
element as a child and a label prop.
1import React from 'react'; 2import Select, {Option} from '@material/react-select'; 3 4class MyApp extends React.Component { 5 state = {value: 'pomsky'}; 6 7 render() { 8 return ( 9 <Select 10 label='Choose Dog' 11 value={this.state.value} 12 onChange={(evt) => this.setState({value: evt.target.value})} 13 > 14 <Option value='pomsky'>Pomsky</Option> 15 <Option value='goldenDoodle'>Golden Doodle</Option> 16 </Select> 17 ); 18 } 19}
NOTE: In order to get access to the value, you must add an
onChange
handler, which accepts an event and updates the value of the select as shown above.
React Select provides a Material styled select, instead of the default native drop down.
1import React from 'react'; 2import Select, {Option} from '@material/react-select'; 3 4class MyApp extends React.Component { 5 state = {value: 'pomsky'}; 6 7 onEnhancedChange = (index, item) => ( 8 this.setState({value: item.getAttribute('data-value')}) 9 ); 10 11 render() { 12 return ( 13 <Select 14 enhanced 15 label='Choose Dog' 16 value={this.state.value} 17 onEnhancedChange={this.onEnhancedChange} 18 > 19 <Option value='pomsky'>Pomsky</Option> 20 <Option value='goldenDoodle'>Golden Doodle</Option> 21 </Select> 22 ); 23 } 24}
If the option elements do not require anything unique, you can omit passing this.props.children
and set the options
prop.
This options shorthand is most useful when your select options come in the form of JSON. Typically, when building a select, the options will be backed by an array of objects or strings (either from an API endpoint or a JSON File). If the label
and value
key names exist in the array of objects, you can run a map
function over that array as shown below.
1import React from 'react'; 2import Select from '@material/react-select'; 3 4class MyApp extends React.Component { 5 state = {value: 'pomsky'}; 6 7 render() { 8 const options = [{ 9 label: 'Pomsky', 10 value: 'pomsky', 11 }, { 12 label: 'Golden Doodle', 13 value: 'goldenDoodle', 14 disabled: true, 15 }]; 16 17 return ( 18 <Select 19 label='Choose Dog' 20 onChange={(evt) => this.setState({value: evt.target.value})} 21 value={this.state.value} 22 options={options} 23 /> 24 ); 25 } 26}
NOTE: If you want a floating label to act as a placeholder, you will need an empty option as documented in the MDC Web Select.
Prop Name | Type | Description |
---|---|---|
children | Array{Element}/Element | Array of <option> elements or a single <option> element. |
className | String | An optional class added to the .mdc-select element. |
disabled | Boolean | Disables the select. |
enhanced | Boolean | Enables the enhanced select. |
floatingLabelClassName | String | An optional class added to the floating label element. |
id | String | Id of the <select> element. |
label | String | Label text that appears as the floating label. |
lineRippleClassName | String | An optional class added to the line ripple element. |
selectClassName | String | An optional class added to the native <select> element. |
notchedOutlineClassName | String | An optional class added to the notched outline element. Only applied if props.outlined is enabled. |
outlined | Boolean | Enables outlined variant. |
options | Array{String/Object} | Array of strings or objects to be used as options. To be used instead of <option> elements passed as this.props.children . If its an array of strings, then the string value will be used as the label and value of the <option> tag. |
value | String | Optional property used to control the selected value outside of <Select> component. |
afterChange | (value: string) => void | Callback for when the select value changed. |
onEnhancedChange | (index: number, target: Element) => void | Callback for when the enhanced select receives a new value. |
onChange | (evt: React.ChangeEvent | Callback for when the native select receives a new value. |
helperText | SelectHelperText | Element to appear as helper text of the select element. |
leadingIcon | SelectIcon | Element to appear as leading icon of the select element. |
The <Option />
component is a provided component to be used for both the enhanced and native select.
When used in the native select, the <Option />
accepts all the same props as the native <option />
tag.
1<Option value='goldenDoodle'>Golden Doodle</Option> 2<Option value='pomsky'>Pomsky</Option>
When used in the enhanced select, the <Option />
component extends from MenuListItem. For your convience other auxilary components of menu are exported from select.
Sass mixins may be available to customize various aspects of the Components. Please refer to the MDC Web repository for more information on what mixins are available, and how to use them.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 28/30 approved changesets -- score normalized to 9
Reason
project is archived
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
185 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More