Skip to content

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';
Learn about the difference by reading this guide on minimizing bundle size.

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

Props

Props of the Input component are also available.

children

The option elements to populate the select with. Can be some <option> elements.

Type:node


classes

Override or extend the styles applied to the component.

See CSS API below for more details.

Type:object

Default:{}


IconComponent

The icon that displays the arrow.

Type:elementType

Default:ArrowDropDownIcon


input

An Input element; does not have to be a material-ui specific Input.

Type:element

Default:<Input />


inputProps

Attributes applied to the select element.

Type:object


onChange

Callback fired when a menu item is selected.

Type:func

Signature:
function(event: React.ChangeEvent) => void
  • event The event source of the callback. You can pull out the new value by accessing event.target.value (string).

sx

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


value

The input value. The DOM API casts this to a string.

Type:any


variant

The variant to use.

Type:'filled'
| 'outlined'
| 'standard'


The 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.


CSS classes

These class names are useful for styling with CSS. They are applied to the component's slots when specific states are triggered.

.Mui-disabledSTATE

State class applied to the select component disabled class.


.Mui-errorSTATE

State class applied to the select component error class.


.MuiNativeSelect-filled

Styles applied to the select component if variant="filled".

Rule name:filled


.MuiNativeSelect-icon

Styles applied to the icon component.

Rule name:icon


.MuiNativeSelect-iconFilled

Styles applied to the icon component if variant="filled".

Rule name:iconFilled


.MuiNativeSelect-iconOpen

Styles applied to the icon component if the popup is open.

Rule name:iconOpen


.MuiNativeSelect-iconOutlined

Styles applied to the icon component if variant="outlined".

Rule name:iconOutlined


.MuiNativeSelect-iconStandard

Styles applied to the icon component if variant="standard".

Rule name:iconStandard


.MuiNativeSelect-multiple

Styles applied to the select component if multiple={true}.

Rule name:multiple


.MuiNativeSelect-nativeInput

Styles applied to the underlying native input component.

Rule name:nativeInput


.MuiNativeSelect-outlined

Styles applied to the select component if variant="outlined".

Rule name:outlined


.MuiNativeSelect-root

Styles applied to the root element.

Rule name:root


.MuiNativeSelect-select

Styles applied to the select component select class.

Rule name:select


.MuiNativeSelect-standard

Styles applied to the select component if variant="standard".

Rule name:standard



You can override the style of the component using one of these customization options:

Edit this page

Was this page helpful?


ModalOutlinedInput

Blog

Store