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
{{ message }}
This repository is currently being migrated. It's locked while the migration is in progress.
Copy file name to clipboardExpand all lines: src/_components/divider.md
+25-2Lines changed: 25 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,10 @@ intro-text: "Dividers are used sparingly to separate significant sections of con
7
7
status: use-best-practice
8
8
web: true
9
9
mobile-app: false
10
+
anchors:
11
+
- anchor: Example
12
+
- anchor: Usage
13
+
- anchor: Accessibility considerations
10
14
---
11
15
12
16
## Example
@@ -24,5 +28,24 @@ mobile-app: false
24
28
25
29
### When to consider something else
26
30
27
-
- Avoid using divider between short, individual items that are in close proximity with one another, _unless_ they are separating navigation links. Consider using white space or headers instead to create vertical separation.
28
-
- Use a background color box or card to separate a chunk of interactive elements, like search controls, from a list of search results.
31
+
***Short items in close proximity.** Avoid using a divider between short, individual items that are close to one another, _unless_ they separate navigation links. Consider using white space or headers instead to create vertical separation.
32
+
***Grouped interactive elements.** Use a background color box or card to separate a chunk of interactive elements, like search controls, from a list of search results.
33
+
34
+
### How this component works
35
+
36
+
The Divider component creates a horizontal rule between sections of content. Use it to separate distinct groups of information when spacing or headings alone don't provide enough visual separation.
37
+
38
+
In most cases, dividers are decorative. If a divider communicates a meaningful change in topic or structure, don't hide it from assistive technology.
39
+
## Accessibility considerations
40
+
41
+
### Decorative vs semantic dividers
42
+
43
+
Not all dividers should be announced to screen readers. Most dividers are decorative when used alongside headings or within well-structured content.
44
+
45
+
**Use `aria-hidden="true"` for decorative dividers when:**
46
+
- The divider only provides visual separation
47
+
- Content structure is already clear through headings or other markup
48
+
49
+
**Do not use `aria-hidden="true"` for semantic dividers when:**
50
+
- The divider marks a significant topic change meaningful to non-visual users
51
+
- The divider is the primary indicator of a content boundary
0 commit comments