`` is a form control for selecting a value from a set of options, similar to the native `` element inside of ``. The native control has several performance, accessibility, and usability advantages. See [the documentation for form-field](https://material.angular.io/components/form-field) for more information. To use a native select inside ``, import `MatInputModule` and add the `matNativeControl` attribute to the `` support all of the form directives from the core `FormsModule` (`NgModel`) and `ReactiveFormsModule` (`FormControl`, `FormGroup`, etc.) As with native `` and ``. These include error messages, hint text, prefix & suffix, and theming. For additional information about these features, see the [form field documentation](https://material.angular.io/components/form-field/overview). ### Setting a static placeholder The placeholder is text shown when the `` label is floating but the `` is empty. It is used to give the user an additional hint about the value they should select. The placeholder can be specified by setting the `placeholder` attribute on the `` element. In some cases that `` may use the placeholder as the label (see the [form field label documentation](https://material.angular.io/components/form-field/overview#floating-label)). ### Disabling the select or individual options It is possible to disable the entire select or individual options in the select by using the disabled property on the ``) is discouraged inside ``, as the inline listbox appearance is inconsistent with other Material Design components. ### Customizing the trigger label If you want to display a custom trigger label inside a ``, you can use the `` element. ### Disabling the ripple effect By default, when a user clicks on a ``, a ripple animation is shown. This can be disabled by setting the `disableRipple` property on ``. ### Adding custom styles to the dropdown panel In order to facilitate easily styling the dropdown panel, `` has a `panelClass` property which can be used to apply additional CSS classes to the dropdown panel. ### Changing when error messages are shown The `` allows you to [associate error messages](https://material.angular.io/components/form-field/overview#error-messages) with your `` element over `MatSelect`. The native control provides the most accessible experience across the widest range of platforms. `MatSelect` implements the combobox pattern detailed in the [1.2 version of the ARIA specification](https://www.w3.org/TR/wai-aria-1.2). The combobox trigger controls a `role="listbox"` element opened in a pop-up. Previous versions of the ARIA specification required that `role="combobox"` apply to a text input control, but the 1.2 version of the specification supports a wider variety of interaction patterns. This newer usage of ARIA works in all browser and screen-reader combinations supported by Angular Material. Because the pop-up uses the `role="listbox"` pattern, you should _not_ put other interactive controls, such as buttons or checkboxes, inside a select option. Nesting interactive controls like this interferes with most assistive technology. Always provide an accessible label for the select. This can be done by adding a `` inside of ``, the `aria-label` attribute, or the `aria-labelledby` attribute. By default, `MatSelect` displays a checkmark to identify selected items. While you can hide the checkmark indicator for single-selection via `hideSingleSelectionIndicator`, this makes the component less accessible by making it harder or impossible for users to visually identify selected items. ### Troubleshooting #### Error: Cannot change `multiple` mode of select after initialization This error is thrown if you attempt to bind the `multiple` property on `` to a dynamic value. (e.g. `[multiple]="isMultiple"` where the value of `isMultiple` changes over the course of the component's lifetime). If you need to change this dynamically, use `@if` or `@switch` instead: ```html @if (isMultiple) { ... } @else { ... } ``` #### Error: Value must be an array in multiple-selection mode This error is thrown if you attempt to assign a value other than `null`, `undefined`, or an array to a ``. For example, something like `mySelect.value = 'option1'`. What you likely meant to do was `mySelect.value = ['option1']`. #### Error: `compareWith` must be a function This error occurs if you attempt to assign something other than a function to the `compareWith` property. For more information on proper usage of `compareWith` see the [Angular forms documentation](https://angular.dev/api/forms/SelectControlValueAccessor#compareWith)).