You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/components/button.md
+23-1
Original file line number
Diff line number
Diff line change
@@ -236,6 +236,28 @@ attribute to buttons whose labels need a more descriptive label.
236
236
<md-elevated-buttonaria-label="Add a new contact">Add</md-elevated-button>
237
237
```
238
238
239
+
### Focusable and disabled
240
+
241
+
By default, disabled buttons are not focusable with the keyboard, while
242
+
"soft-disabled" buttons are. Some use cases encourage focusability of disabled
243
+
toolbar items to increase their discoverability.
244
+
245
+
See the
246
+
[ARIA guidelines on focusability of disabled controls](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_disabled_controls)<!-- {.external} -->
247
+
for guidance on when this is recommended.
248
+
249
+
```html
250
+
<divrole="toolbar">
251
+
<md-text-button>Copy</md-text-button>
252
+
<md-text-button>Cut</md-text-button>
253
+
<!--
254
+
This button is disabled but kept focusable to improve its discoverability
|`disabled`|`disabled`|`boolean`|`false`| Whether or not the button is disabled. |
737
+
|`softDisabled`|`soft-disabled`|`boolean`|`false`| Whether the button is "soft-disabled" (disabled but still focusable). |
716
738
|`href`|`href`|`string`|`''`| The URL that the link button points to. |
717
739
|`target`|`target`|`string`|`''`| Where to display the linked `href` URL for a link button. Common options include `_blank` to open in a new tab. |
718
740
|`trailingIcon`|`trailing-icon`|`boolean`|`false`| Whether to render the icon at the inline end of the label rather than the inline start.<br>_Note:_ Link buttons cannot have trailing icons. |
Copy file name to clipboardExpand all lines: docs/components/icon-button.md
+31-3
Original file line number
Diff line number
Diff line change
@@ -196,6 +196,34 @@ more descriptive label when selected.
196
196
</md-icon-button>
197
197
```
198
198
199
+
### Focusable and disabled
200
+
201
+
By default, disabled icon buttons are not focusable with the keyboard, while
202
+
"soft-disabled" icon buttons are. Some use cases encourage focusability of
203
+
disabled toolbar items to increase their discoverability.
204
+
205
+
See the
206
+
[ARIA guidelines on focusability of disabled controls](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_disabled_controls)<!-- {.external} -->
207
+
for guidance on when this is recommended.
208
+
209
+
```html
210
+
<divrole="toolbar">
211
+
<md-icon-buttonaria-label="Copy">
212
+
<md-icon>copy</md-icon>
213
+
</md-icon-button>
214
+
<md-icon-buttonaria-label="Cut">
215
+
<md-icon>cut</md-icon>
216
+
</md-icon-button>
217
+
<!--
218
+
This icon button is disabled but kept focusable to improve its
219
+
discoverability in the toolbar.
220
+
-->
221
+
<md-icon-buttonaria-label="Paste"soft-disabled>
222
+
<md-icon>paste</md-icon>
223
+
</md-icon-button>
224
+
</div>
225
+
```
226
+
199
227
## Icon Button
200
228
201
229
Standard icon buttons do not have a background or outline, and have the lowest
0 commit comments