|
1 |
| -`<mat-button-toggle>` are on/off toggles with the appearance of a button. These toggles can be |
2 |
| -configured to behave as either radio-buttons or checkboxes. While they can be standalone, they are |
| 1 | +`<mat-button-toggle>` are on/off toggles with the appearance of a button. These toggles can be |
| 2 | +configured to behave as either radio-buttons or checkboxes. While they can be standalone, they are |
3 | 3 | typically part of a `mat-button-toggle-group`.
|
4 | 4 |
|
5 | 5 |
|
6 | 6 | <!-- example(button-toggle-overview) -->
|
7 | 7 |
|
8 | 8 | ### Exclusive selection vs. multiple selection
|
9 | 9 | By default, `mat-button-toggle-group` acts like a radio-button group- only one item can be selected.
|
10 |
| -In this mode, the `value` of the `mat-button-toggle-group` will reflect the value of the selected |
11 |
| -button and `ngModel` is supported. |
| 10 | +In this mode, the `value` of the `mat-button-toggle-group` will reflect the value of the selected |
| 11 | +button and `ngModel` is supported. |
12 | 12 |
|
13 | 13 | Adding the `multiple` attribute allows multiple items to be selected (checkbox behavior). In this
|
14 |
| -mode the values of the the toggles are not used, the `mat-button-toggle-group` does not have a value, |
| 14 | +mode the values of the the toggles are not used, the `mat-button-toggle-group` does not have a value, |
15 | 15 | and `ngModel` is not supported.
|
16 | 16 |
|
| 17 | +### Appearance |
| 18 | +By default, the appearance of `mat-button-toggle-group` and `mat-button-toggle` will follow the |
| 19 | +latest Material Design guidelines. If you want to, you can switch back to the appearance that was |
| 20 | +following the previous Material Design spec by using the `appearance` input. The `appearance` can |
| 21 | +be configured globally using the `MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS` injection token. |
| 22 | + |
| 23 | +<!-- example(button-toggle-appearance) --> |
| 24 | + |
17 | 25 | ### Accessibility
|
18 | 26 | The button-toggles will present themselves as either checkboxes or radio-buttons based on the
|
19 |
| -presence of the `multiple` attribute. |
| 27 | +presence of the `multiple` attribute. |
20 | 28 |
|
21 | 29 | For button toggles containing only icons, each button toggle should be given a meaningful label via
|
22 | 30 | `aria-label` or `aria-labelledby`.
|
|
0 commit comments