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/content/PageLayout.mdx
+110Lines changed: 110 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -200,6 +200,85 @@ See [storybook](https://primer.style/react/storybook?path=/story/layout-pagelayo
200
200
</Box>
201
201
```
202
202
203
+
### With `aria-label`
204
+
205
+
Using `aria-label` along with `PageLayout.Header`, `PageLayout.Content`, or `PageLayout.Footer` creates a unique label for that landmark role that can make it easier to navigate between sections of content on a page.
206
+
207
+
```jsx live
208
+
<PageLayout>
209
+
<PageLayout.Header aria-label="header">
210
+
<Placeholder label="Header" height={64} />
211
+
</PageLayout.Header>
212
+
<PageLayout.Content aria-label="content">
213
+
<Placeholder label="Content" height={240} />
214
+
</PageLayout.Content>
215
+
<PageLayout.Pane>
216
+
<Placeholder label="Pane" height={120} />
217
+
</PageLayout.Pane>
218
+
<PageLayout.Footer aria-label="footer">
219
+
<Placeholder label="Footer" height={64} />
220
+
</PageLayout.Footer>
221
+
</PageLayout>
222
+
```
223
+
224
+
### With `aria-labelledby`
225
+
226
+
Using `aria-labelledby` along with `PageLayout.Header`, `PageLayout.Content`, or `PageLayout.Footer` creates a unique label for each landmark role by using the given `id` to associate the landmark with the content with the corresponding `id`. This is helpful when you have a visible item that visually communicates the type of content which you would like to associate to the landmark itself.
The `PageLayout` component uses [landmark roles](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/landmark_role) for `PageLayout.Header`, `PageLayout.Content`, and `PageLayout.Footer` in order to make it easier for screen reader users to navigate between sections of the page.
Each component may be labeled through either `aria-label` or `aria-labelledby` in order to provide a unique label for the landmark. This can be helpful when there are multiple landmarks of the same type on the page.
Most screen readers provide a mechanism through which you can navigate between landmarks on the page. Typically, this is done through a specific keyboard shortcut or through an option in a rotor.
267
+
268
+
#### JAWS
269
+
270
+
JAWS supports landmark regions and the details in which it presents them depends on the Web Verbosity Level setting. You can navigate to the next landmark on the page by pressing `R` and the previous landmark by pressing `Shift-R`.
271
+
272
+
#### NVDA
273
+
274
+
NVDA supports landmark regions and you can navigate to the next landmark by using pressing `D` and to the previous landmark by pressing `Shift-D`. You may also list out the landmarks by pressing `Insert-F7`.
275
+
276
+
#### VoiceOver
277
+
278
+
VoiceOver supports [assigning landmark roles](https://support.apple.com/guide/voiceover/by-landmarks-vo35709/mac) to areas of a page. In order to navigate between landmarks, you can use the [rotor](https://support.apple.com/guide/voiceover/with-the-voiceover-rotor-mchlp2719/10/mac/12.0).
279
+
280
+
On macOS, you can open the VoiceOver rotor by pressing `VO-U`. You can navigate between lists to find the `Landmarks` list by using the Right Arrow or Left Arrow key. From that list, you can use the Down Arrow and Up Arrow keys to navigate between landmarks identified on the page.
281
+
203
282
## Props
204
283
205
284
### PageLayout
@@ -242,6 +321,16 @@ See [storybook](https://primer.style/react/storybook?path=/story/layout-pagelayo
242
321
### PageLayout.Header
243
322
244
323
<PropsTable>
324
+
<PropsTableRow
325
+
name="aria-label"
326
+
type={`string | undefined`}
327
+
description="A unique label for the rendered banner landmark"
328
+
/>
329
+
<PropsTableRow
330
+
name="aria-labelledby"
331
+
type={`string | undefined`}
332
+
description="An id to an element which uniquely labels the rendered banner landmark"
333
+
/>
245
334
<PropsTableRow
246
335
name="padding"
247
336
type={`| 'none'
@@ -295,6 +384,16 @@ See [storybook](https://primer.style/react/storybook?path=/story/layout-pagelayo
295
384
### PageLayout.Content
296
385
297
386
<PropsTable>
387
+
<PropsTableRow
388
+
name="aria-label"
389
+
type={`string | undefined`}
390
+
description="A unique label for the rendered main landmark"
391
+
/>
392
+
<PropsTableRow
393
+
name="aria-labelledby"
394
+
type={`string | undefined`}
395
+
description="An id to an element which uniquely labels the rendered main landmark"
396
+
/>
298
397
<PropsTableRow
299
398
name="width"
300
399
type={`| 'full'
@@ -428,6 +527,17 @@ See [storybook](https://primer.style/react/storybook?path=/story/layout-pagelayo
428
527
### PageLayout.Footer
429
528
430
529
<PropsTable>
530
+
<PropsTableRow
531
+
name="aria-label"
532
+
type={`string | undefined`}
533
+
description="A unique label for the rendered contentinfo landmark"
534
+
/>
535
+
<PropsTableRow
536
+
name="aria-labelledby"
537
+
type={`string | undefined`}
538
+
description="An id to an element which uniquely labels the rendered contentinfo landmark"
0 commit comments