Select

Select menus display a list of choices on temporary surfaces and display the currently selected menu item above the menu.

A textfield containing the text Item 2, with a dropdown menu containing Item 1, Item 2, and Item 3.

Select (also referred to as a dropdown menu) allows choosing a value from a fixed list of available options. It is analogous to the native HTML <select> element.

Apple
Apricot
Apple
Apricot
<md-outlined-select>
  <md-select-option aria-label="blank"></md-select-option>
  <md-select-option selected value="apple">
    <div slot="headline">Apple</div>
  </md-select-option>
  <md-select-option value="apricot">
    <div slot="headline">Apricot</div>
  </md-select-option>
</md-outlined-select>

<md-filled-select>
  <md-select-option aria-label="blank"></md-select-option>
  <md-select-option value="apple">
    <div slot="headline">Apple</div>
  </md-select-option>
  <md-select-option value="apricot">
    <div slot="headline">Apricot</div>
  </md-select-option>
</md-filled-select>

Indicate that a selection is mandatory by adding the required attribute.

<md-filled-select required>
  <md-select-option value="one">
    <div slot="headline">One</div>
  </md-select-option>
  <md-select-option value="two">
    <div slot="headline">Two</div>
  </md-select-option>
</md-filled-select>

Select supports Material theming and can be customized in terms of color, typography, and shape.

TokenDefault value
--md-filled-select-text-field-container-color--md-sys-color-surface-container-highest
--md-filled-select-text-field-container-shape4px
--md-filled-select-text-field-input-text-color--md-sys-color-on-surface
--md-filled-select-text-field-input-text-font--md-sys-typescale-body-large-font

To theme the select's dropdown menu, use the md-menu component tokens on the ::part(menu) selector.

Apple
Tomato
<style>
:root {
  --md-filled-select-text-field-container-shape: 0px;
  --md-filled-select-text-field-container-color: #f7faf9;
  --md-filled-select-text-field-input-text-color: #005353;
  --md-filled-select-text-field-input-text-font: system-ui;
}

md-filled-select::part(menu) {
  --md-menu-container-color: #f4fbfa;
  --md-menu-container-shape: 0px;
}
</style>

<md-filled-select>
  <md-select-option selected value="apple">
    <div slot="headline">Apple</div>
  </md-select-option>
  <md-select-option value="tomato">
    <div slot="headline">Tomato</div>
  </md-select-option>
</md-filled-select>
TokenDefault value
--md-outlined-select-text-field-outline-color--md-sys-color-outline
--md-outlined-select-text-field-container-shape4px
--md-outlined-select-text-field-input-text-color--md-sys-color-on-surface
--md-outlined-select-text-field-input-text-font--md-sys-typescale-body-large-font
Apple
Tomato
<style>
:root {
  --md-outlined-select-text-field-outline-color: #6e7979;
  --md-outlined-select-text-field-container-shape: 0px;
  --md-outlined-select-text-field-input-text-color: #005353;
  --md-outlined-select-text-field-input-text-font: system-ui;
}

md-outlined-select::part(menu) {
  --md-menu-container-color: #f4fbfa;
  --md-menu-container-shape: 0px;
}
</style>

<md-outlined-select>
  <md-select-option selected value="apple">
    <div slot="headline">Apple</div>
  </md-select-option>
  <md-select-option value="tomato">
    <div slot="headline">Tomato</div>
  </md-select-option>
</md-outlined-select>

MdFilledSelect <md-filled-select>

Link to “MdFilledSelect <md-filled-select>”
PropertyAttributeTypeDefaultDescription
quickquickbooleanfalseOpens the menu synchronously with no animation.
requiredrequiredbooleanfalseWhether or not the select is required.
disableddisabledbooleanfalseDisables the select.
errorTexterror-textstring''The error message that replaces supporting text when error is true. If errorText is an empty string, then the supporting text will continue to show.
This error message overrides the error message displayed by reportValidity().
labellabelstring''The floating label for the field.
supportingTextsupporting-textstring''Conveys additional information below the select, such as how it should be used.
errorerrorbooleanfalseGets or sets whether or not the select is in a visually invalid state.
This error state overrides the error state controlled by reportValidity().
menuPositioningmenu-positioningstring'absolute'Whether or not the underlying md-menu should be position: fixed to display in a top-level manner, or position: absolute.
position:fixed is useful for cases where select is inside of another element with stacking context and hidden overflows such as md-dialog.
typeaheadDelaytypeahead-delaynumberDEFAULT_TYPEAHEAD_BUFFER_TIMEThe max time between the keystrokes of the typeahead select / menu behavior before it clears the typeahead buffer.
hasLeadingIconhas-leading-iconbooleanfalseWhether or not the text field has a leading icon. Used for SSR.
displayTextdisplay-textstring''Text to display in the field. Only set for SSR.
valuevaluestringundefined
selectedIndexselected-indexnumberundefined
optionsSelectOption[]undefined
selectedOptionsSelectOption[]undefined
namestringundefined
formHTMLFormElementundefined
labelsNodeListundefined
validityValidityStateundefined
validationMessagestringundefined
willValidatebooleanundefined
MethodParametersReturnsDescription
selectvaluevoidSelects an option given the value of the option, and updates MdSelect's value.
selectIndexindexvoidSelects an option given the index of the option, and updates MdSelect's value.
resetNonevoidReset the select to its default value.
checkValidityNonebooleanChecks the select's native validation and returns whether or not the element is valid.
If invalid, this method will dispatch the invalid event.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement/checkValidity
reportValidityNonebooleanChecks the select's native validation and returns whether or not the element is valid.
If invalid, this method will dispatch the invalid event.
This method will display or clear an error text message equal to the select's validationMessage, unless the invalid event is canceled.
Use setCustomValidity() to customize the validationMessage.
This method can also be used to re-announce error messages to screen readers.
setCustomValidityerrorvoidSets the select's native validation error message. This is used to customize validationMessage.
When the error is not an empty string, the select is considered invalid and validity.customError will be true.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement/setCustomValidity
getUpdateCompleteNonePromise<boolean>
EventDescription
inputFired when a selection is made by the user via mouse or keyboard interaction.
changeFired when a selection is made by the user via mouse or keyboard interaction.
openingFired when the select's menu is about to open.
openedFired when the select's menu has finished animations and opened.
closingFired when the select's menu is about to close.
closedFired when the select's menu has finished animations and closed.

MdOutlinedSelect <md-outlined-select>

Link to “MdOutlinedSelect <md-outlined-select>”
PropertyAttributeTypeDefaultDescription
quickquickbooleanfalseOpens the menu synchronously with no animation.
requiredrequiredbooleanfalseWhether or not the select is required.
disableddisabledbooleanfalseDisables the select.
errorTexterror-textstring''The error message that replaces supporting text when error is true. If errorText is an empty string, then the supporting text will continue to show.
This error message overrides the error message displayed by reportValidity().
labellabelstring''The floating label for the field.
supportingTextsupporting-textstring''Conveys additional information below the select, such as how it should be used.
errorerrorbooleanfalseGets or sets whether or not the select is in a visually invalid state.
This error state overrides the error state controlled by reportValidity().
menuPositioningmenu-positioningstring'absolute'Whether or not the underlying md-menu should be position: fixed to display in a top-level manner, or position: absolute.
position:fixed is useful for cases where select is inside of another element with stacking context and hidden overflows such as md-dialog.
typeaheadDelaytypeahead-delaynumberDEFAULT_TYPEAHEAD_BUFFER_TIMEThe max time between the keystrokes of the typeahead select / menu behavior before it clears the typeahead buffer.
hasLeadingIconhas-leading-iconbooleanfalseWhether or not the text field has a leading icon. Used for SSR.
displayTextdisplay-textstring''Text to display in the field. Only set for SSR.
valuevaluestringundefined
selectedIndexselected-indexnumberundefined
optionsSelectOption[]undefined
selectedOptionsSelectOption[]undefined
namestringundefined
formHTMLFormElementundefined
labelsNodeListundefined
validityValidityStateundefined
validationMessagestringundefined
willValidatebooleanundefined
MethodParametersReturnsDescription
selectvaluevoidSelects an option given the value of the option, and updates MdSelect's value.
selectIndexindexvoidSelects an option given the index of the option, and updates MdSelect's value.
resetNonevoidReset the select to its default value.
checkValidityNonebooleanChecks the select's native validation and returns whether or not the element is valid.
If invalid, this method will dispatch the invalid event.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement/checkValidity
reportValidityNonebooleanChecks the select's native validation and returns whether or not the element is valid.
If invalid, this method will dispatch the invalid event.
This method will display or clear an error text message equal to the select's validationMessage, unless the invalid event is canceled.
Use setCustomValidity() to customize the validationMessage.
This method can also be used to re-announce error messages to screen readers.
setCustomValidityerrorvoidSets the select's native validation error message. This is used to customize validationMessage.
When the error is not an empty string, the select is considered invalid and validity.customError will be true.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement/setCustomValidity
getUpdateCompleteNonePromise<boolean>
EventDescription
inputFired when a selection is made by the user via mouse or keyboard interaction.
changeFired when a selection is made by the user via mouse or keyboard interaction.
openingFired when the select's menu is about to open.
openedFired when the select's menu has finished animations and opened.
closingFired when the select's menu is about to close.
closedFired when the select's menu has finished animations and closed.

MdSelectOption <md-select-option>

Link to “MdSelectOption <md-select-option>”
PropertyAttributeTypeDefaultDescription
disableddisabledbooleanfalseDisables the item and makes it non-selectable and non-interactive.
selectedselectedbooleanfalseSets the item in the selected visual state when a submenu is opened.
valuevaluestring''Form value of the option.
typestring'option' as const
typeaheadTextstringundefined
displayTextstringundefined
EventDescription
close-menuCloses the encapsulating menu on
request-selectionRequests the parent md-select to select this element (and deselect others if single-selection) when selected changed to true.
request-deselectionRequests the parent md-select to deselect this element when selected changed to false.
About
IntroductionQuick StartRoadmapSupportBundle Sizes
Theming
Material ThemingColorTypography
Components
ButtonsCheckboxChipsDialogsFloating action button (FAB)Icon ButtonsListsMenusProgress indicatorsRadioRippleSelectSlidersSwitchTabsText field