File tree Expand file tree Collapse file tree 2 files changed +66
-0
lines changed
Expand file tree Collapse file tree 2 files changed +66
-0
lines changed Original file line number Diff line number Diff line change 1+ # menu-button-needs-labelling
2+
3+ MenuButton components must have accessible labelling for screen readers.
4+
5+ ## Rule Details
6+
7+ This rule enforces that MenuButton components have proper accessible names through aria-label, aria-labelledby, or text content.
8+
9+ ### Noncompliant
10+
11+ ``` jsx
12+ < MenuButton / >
13+ ```
14+
15+ ### Compliant
16+
17+ ``` jsx
18+ < MenuButton aria- label= " Menu options" / >
19+
20+ < MenuButton aria- labelledby= " menu-label" >
21+ < span id= " menu-label" > Options< / span>
22+ < / MenuButton>
23+
24+ < MenuButton> Options< / MenuButton>
25+ ```
26+
27+ ## When Not To Use
28+
29+ This rule should always be used for MenuButton components as they are interactive elements.
30+
31+ ## Accessibility guidelines
32+
33+ - [ WCAG 4.1.2] ( https://www.w3.org/WAI/WCAG21/Understanding/name-role-value.html )
Original file line number Diff line number Diff line change 1+ # split-button-needs-labelling
2+
3+ SplitButton components must have accessible labelling for screen readers.
4+
5+ ## Rule Details
6+
7+ This rule enforces that SplitButton components have proper accessible names through aria-label, aria-labelledby, or text content.
8+
9+ ### Noncompliant
10+
11+ ``` jsx
12+ < SplitButton / >
13+ ```
14+
15+ ### Compliant
16+
17+ ``` jsx
18+ < SplitButton aria- label= " Save options" / >
19+
20+ < SplitButton aria- labelledby= " save-label" >
21+ < span id= " save-label" > Save< / span>
22+ < / SplitButton>
23+
24+ < SplitButton> Save< / SplitButton>
25+ ```
26+
27+ ## When Not To Use
28+
29+ This rule should always be used for SplitButton components as they are interactive elements.
30+
31+ ## Accessibility guidelines
32+
33+ - [ WCAG 4.1.2] ( https://www.w3.org/WAI/WCAG21/Understanding/name-role-value.html )
You can’t perform that action at this time.
0 commit comments