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: README.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -178,6 +178,7 @@ Any use of third-party trademarks or logos are subject to those third-party's po
178
178
|[avoid-using-aria-describedby-for-primary-labelling](docs/rules/avoid-using-aria-describedby-for-primary-labelling.md)| aria-describedby provides additional context and is not meant for primary labeling. | ✅ |||
|[breadcrumb-needs-labelling](docs/rules/breadcrumb-needs-labelling.md)| All interactive elements must have an accessible name | ✅ |||
181
+
|[card-needs-accessible-name](docs/rules/card-needs-accessible-name.md)| Accessibility: Interactive Card must have an accessible name via aria-label, aria-labelledby, etc. | ✅ |||
181
182
|[checkbox-needs-labelling](docs/rules/checkbox-needs-labelling.md)| Accessibility: Checkbox without label must have an accessible and visual label: aria-labelledby | ✅ |||
182
183
|[colorswatch-needs-labelling](docs/rules/colorswatch-needs-labelling.md)| Accessibility: ColorSwatch must have an accessible name via aria-label, Tooltip, aria-labelledby, etc.. | ✅ |||
183
184
|[combobox-needs-labelling](docs/rules/combobox-needs-labelling.md)| All interactive elements must have an accessible name | ✅ |||
@@ -191,8 +192,10 @@ Any use of third-party trademarks or logos are subject to those third-party's po
191
192
|[image-button-missing-aria](docs/rules/image-button-missing-aria.md)| Accessibility: Image buttons must have accessible labelling: title, aria-label, aria-labelledby, aria-describedby | ✅ |||
192
193
|[image-needs-alt](docs/rules/image-needs-alt.md)| Accessibility: Image must have alt attribute with a meaningful description of the image. If the image is decorative, use alt="". | ✅ |||
193
194
|[imageswatch-needs-labelling](docs/rules/imageswatch-needs-labelling.md)| Accessibility: ImageSwatch must have an accessible name via aria-label, Tooltip, aria-labelledby, etc.. | ✅ |||
195
+
|[infolabel-needs-labelling](docs/rules/infolabel-needs-labelling.md)| Accessibility: InfoLabel must have an accessible name via aria-label, text content, aria-labelledby, etc. | ✅ |||
194
196
|[input-components-require-accessible-name](docs/rules/input-components-require-accessible-name.md)| Accessibility: Input fields must have accessible labelling: aria-label, aria-labelledby or an associated label | ✅ |||
195
197
|[link-missing-labelling](docs/rules/link-missing-labelling.md)| Accessibility: Image links must have an accessible name. Add either text content, labelling to the image or labelling to the link itself. | ✅ || 🔧 |
198
+
|[menu-button-needs-labelling](docs/rules/menu-button-needs-labelling.md)| Accessibility: MenuButton must have an accessible name via aria-label, text content, aria-labelledby, etc. | ✅ |||
196
199
|[menu-item-needs-labelling](docs/rules/menu-item-needs-labelling.md)| Accessibility: MenuItem without label must have an accessible and visual label: aria-labelledby | ✅ |||
197
200
|[no-empty-buttons](docs/rules/no-empty-buttons.md)| Accessibility: Button, ToggleButton, SplitButton, MenuButton, CompoundButton must either text content or icon or child component | ✅ |||
198
201
|[no-empty-components](docs/rules/no-empty-components.md)| FluentUI components should not be empty | ✅ |||
# Accessibility: Interactive Card must have an accessible name via aria-label, aria-labelledby, etc (`@microsoft/fluentui-jsx-a11y/card-needs-accessible-name`)
2
+
3
+
💼 This rule is enabled in the ✅ `recommended` config.
4
+
5
+
<!-- end auto-generated rule header -->
6
+
7
+
Interactive Card components must have an accessible name for screen readers.
8
+
9
+
## Rule Details
10
+
11
+
This rule enforces that Card components have proper accessible names when they are interactive (clickable).
# Accessibility: InfoLabel must have an accessible name via aria-label, text content, aria-labelledby, etc (`@microsoft/fluentui-jsx-a11y/infolabel-needs-labelling`)
2
+
3
+
💼 This rule is enabled in the ✅ `recommended` config.
4
+
5
+
<!-- end auto-generated rule header -->
6
+
7
+
InfoLabel components must have accessible labelling for screen readers.
8
+
9
+
## Rule Details
10
+
11
+
This rule enforces that InfoLabel components have proper accessible names through aria-label, aria-labelledby, or text content.
12
+
13
+
### Noncompliant
14
+
15
+
```jsx
16
+
<InfoLabel />
17
+
```
18
+
19
+
### Compliant
20
+
21
+
```jsx
22
+
<InfoLabel aria-label="Additional information"/>
23
+
24
+
<InfoLabel aria-labelledby="info-text">
25
+
<span id="info-text">Help text</span>
26
+
</InfoLabel>
27
+
28
+
<InfoLabel>Help information</InfoLabel>
29
+
```
30
+
31
+
## When Not To Use
32
+
33
+
If the InfoLabel is purely decorative, this rule may not be necessary.
# Accessibility: MenuButton must have an accessible name via aria-label, text content, aria-labelledby, etc (`@microsoft/fluentui-jsx-a11y/menu-button-needs-labelling`)
2
+
3
+
💼 This rule is enabled in the ✅ `recommended` config.
4
+
5
+
<!-- end auto-generated rule header -->
6
+
7
+
MenuButton components must have accessible labelling for screen readers.
8
+
9
+
## Rule Details
10
+
11
+
This rule enforces that MenuButton components have proper accessible names through aria-label, aria-labelledby, or text content.
12
+
13
+
### Noncompliant
14
+
15
+
```jsx
16
+
<MenuButton />
17
+
```
18
+
19
+
### Compliant
20
+
21
+
```jsx
22
+
<MenuButton aria-label="Menu options"/>
23
+
24
+
<MenuButton aria-labelledby="menu-label">
25
+
<span id="menu-label">Options</span>
26
+
</MenuButton>
27
+
28
+
<MenuButton>Options</MenuButton>
29
+
```
30
+
31
+
## When Not To Use
32
+
33
+
This rule should always be used for MenuButton components as they are interactive elements.
0 commit comments