Skip to content

Commit 200d8de

Browse files
committed
docs(a11y): Adding accessibility sections to datepicker, menu, slide toggle, slider, snackbar and toolbar
1 parent 4b3d3d5 commit 200d8de

File tree

6 files changed

+27
-0
lines changed

6 files changed

+27
-0
lines changed

src/lib/datepicker/datepicker.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,3 +228,6 @@ application root module.
228228
})
229229
export class MyApp {}
230230
```
231+
### Accessibility
232+
The input box for datepicker should have a placeholder or be given a meaningful label via
233+
`aria-label` or `aria-labelledby`.

src/lib/menu/menu.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,7 @@ that should trigger the sub-menu:
9898
- <kbd>RIGHT_ARROW</kbd>: Opens the menu item's sub-menu
9999
- <kbd>LEFT_ARROW</kbd>: Closes the current menu, if it is a sub-menu.
100100
- <kbd>ENTER</kbd>: Activates the focused menu item
101+
102+
### Accessibility
103+
Menu triggers or menu items without text or labels should be given a meaningful label via
104+
`aria-label` or `aria-labelledby`.

src/lib/slide-toggle/slide-toggle.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,11 @@ and `ReactiveFormsModule`.
2222
### Theming
2323
The color of a `<md-slide-toggle>` can be changed by using the `color` property. By default,
2424
slide-toggles use the theme's accent color. This can be changed to `'primary'` or `'warn'`.
25+
26+
### Accessibility
27+
The `<md-slide-toggle>` uses an internal `<input type="checkbox">` to provide an accessible
28+
experience. This internal checkbox receives focus and is automatically labelled by the text content
29+
of the `<md-slide-toggle>` element.
30+
31+
Slide toggles without text or labels should be given a meaningful label via `aria-label` or
32+
`aria-labelledby`.

src/lib/slider/slider.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,7 @@ The slider has the following keyboard bindings:
8585
| Page down | Decrement the slider value by 10 steps. |
8686
| End | Set the value to the maximum possible. |
8787
| Home | Set the value to the minimum possible. |
88+
89+
### Accessibility
90+
Sliders without text or labels should be given a meaningful label via `aria-label` or
91+
`aria-labelledby`.

src/lib/snack-bar/snack-bar.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,7 @@ export class MessageArchivedComponent {
7272
constructor(@Inject(MD_SNACK_BAR_DATA) public data: any) { }
7373
}
7474
```
75+
### Accessibility
76+
A Snackbar automatically goes away after a short time, so you can't count on the user seeing the
77+
message or having a chance to press the button. For this reason, you should consider offering an
78+
alternate way to perform any Snackbar action.

src/lib/toolbar/toolbar.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,7 @@ easily accomplished with `display: flex`:
4949
The color of a `<md-toolbar>` can be changed by using the `color` property. By default, toolbars
5050
use a neutral background color based on the current theme (light or dark). This can be changed to
5151
`'primary'`, `'accent'`, or `'warn'`.
52+
53+
### Accessibility
54+
Toolbar items without text or labels should be given a meaningful label via `aria-label` or
55+
`aria-labelledby`.

0 commit comments

Comments
 (0)