Overview
<mat-radio-button> provides the same functionality as a native <input type="radio"> enhanced with Material Design styling and animations. Radio buttons are typically used within a <mat-radio-group> to create a set of mutually exclusive options.
Basic Usage
- Template
- Reactive Forms
API Reference
MatRadioGroup
Selector:mat-radio-group
Exported as: matRadioGroup
Inputs
Name of the radio button group. All radio buttons inside this group will use this name.
Value for the radio-group. Should equal the value of the selected radio button if there is a corresponding radio button with a matching value.
The currently selected radio button. If set to a new radio button, the radio group value will be updated to match the new selected button.
Whether the radio group is disabled.
Whether the radio group is required.
Whether the labels should appear after or before the radio buttons. Defaults to ‘after’.
Theme color of the radio buttons in the group. This API is supported in M2 themes only.
Whether buttons in the group should be interactive while they’re disabled.
Outputs
Event emitted when the group value changes. Change events are only emitted when the value changes due to user interaction.
MatRadioButton
Selector:mat-radio-button
Exported as: matRadioButton
Inputs
A unique id for the radio button. Auto-generated if not provided.
Analog to HTML ‘name’ attribute used to group radios for unique selection.
The value of this radio button.
Whether the radio button is checked.
Whether the radio button is disabled.
Whether the label should appear after or before the radio button. Defaults to ‘after’.
Theme color of the radio button. This API is supported in M2 themes only.
Whether ripples are disabled on the radio button.
Whether the radio button should remain interactive when it is disabled.
Tabindex of the radio button.
Outputs
Event emitted when the checked state of this radio button changes.
MatRadioChange
The radio button that emits the change event.
The value of the radio button.
Accessibility
- The radio group uses
role="radiogroup" - Each radio button uses a native
<input type="radio">element - Labels are properly associated with radio buttons
- Use the
nameattribute to group related radio buttons - Keyboard navigation is fully supported (Arrow keys to navigate, Space to select)
- Screen readers announce the current selection and group information
- Disabled radio buttons are not focusable and are announced as disabled