NativeSelect API
API reference docs for the React NativeSelect component. Learn about the props, CSS, and other APIs of this exported module.
Component demos
Import
import NativeSelect from '@mui/material/NativeSelect';
// or
import { NativeSelect } from '@mui/material';
An alternative to <Select native />
with a much smaller bundle size footprint.
Props of the Input component are also available.
Override or extend the styles applied to the component.
See CSS API below for more details.
Type:object
Default:{}
An Input
element; does not have to be a material-ui specific Input
.
Type:element
Default:<Input />
Callback fired when a menu item is selected.
Type:func
function(event: React.ChangeEvent) => void
event
The event source of the callback. You can pull out the new value by accessingevent.target.value
(string).
The system prop that allows defining system overrides as well as additional CSS styles.
See the `sx` page for more details.
Type:Array<func
| object
| bool>
| func
| object
ref
is forwarded to the root element.Inheritance
While not explicitly documented above, the props of the Input component are also available in NativeSelect. You can take advantage of this to target nested components.
Theme default props
You can use MuiNativeSelect
to change the default props of this component with the theme.
These class names are useful for styling with CSS. They are applied to the component's slots when specific states are triggered.
Styles applied to the icon component if variant="filled"
.
Rule name:iconFilled
Styles applied to the icon component if the popup is open.
Rule name:iconOpen
Styles applied to the icon component if variant="outlined"
.
Rule name:iconOutlined
Styles applied to the icon component if variant="standard"
.
Rule name:iconStandard
Styles applied to the select component if multiple={true}
.
Rule name:multiple
Styles applied to the underlying native input component.
Rule name:nativeInput
Styles applied to the select component if variant="outlined"
.
Rule name:outlined
You can override the style of the component using one of these customization options:
- With a global class name.
- With a rule name as part of the component's
styleOverrides
property in a custom theme.