Skip to content

NativeSelect API

The API documentation of the NativeSelect React component. Learn more about the props and the CSS customization points.

import { NativeSelect } from '@material-ui/core';

An alternative to <Select native /> with a much smaller bundle size footprint.

Props

Name Type Default Description
children node The option elements to populate the select with. Can be some <option> elements.
classes object Override or extend the styles applied to the component. See CSS API below for more details.
IconComponent elementType ArrowDropDownIcon The icon that displays the arrow.
input element <Input /> An Input element; does not have to be a material-ui specific Input.
inputProps object Attributes applied to the select element.
onChange func Callback function fired when a menu item is selected.

Signature:
function(event: object) => void
event: The event source of the callback. You can pull out the new value by accessing event.target.value.
value any The input value.
variant 'standard'
| 'outlined'
| 'filled'
The variant to use.

The ref is forwarded to the root element.

Any other props supplied will be provided to the root element (Input).

CSS

  • Style sheet name: MuiNativeSelect.
  • Style sheet details:
Rule name Global class Description
root MuiNativeSelect-root Styles applied to the select component root class.
select MuiNativeSelect-select Styles applied to the select component select class.
filled MuiNativeSelect-filled Styles applied to the select component if variant="filled".
outlined MuiNativeSelect-outlined Styles applied to the select component if variant="outlined".
selectMenu MuiNativeSelect-selectMenu Styles applied to the select component selectMenu class.
disabled Mui-disabled Pseudo-class applied to the select component disabled class.
icon MuiNativeSelect-icon Styles applied to the select component icon class.

You can override the style of the component thanks to one of these customization points:

If that's not sufficient, you can check the implementation of the component for more detail.

Inheritance

The props of the Input component are also available. You can take advantage of this behavior to target nested components.

Notes

The component is fully StrictMode compatible.

Demos