Skip to content

Commit 4a40085

Browse files
joshblackcolebemis
andauthored
docs(PageLayout): add docs with NavList and landmarks (#2349)
* docs(PageLayout): add docs with NavList and landmarks * Update docs/content/PageLayout.mdx Co-authored-by: Cole Bemis <[email protected]> Co-authored-by: Cole Bemis <[email protected]>
1 parent 9eaa37e commit 4a40085

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

docs/content/PageLayout.mdx

+47
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,39 @@ Add `offsetHeader` prop to specify the height of the custom sticky header along
202202
</Box>
203203
```
204204

205+
### With `NavList`
206+
207+
`PageLayout.Pane` by itself does not specify or provide landmark roles. Using
208+
components that define their own landmark roles, such as [`NavList`](/NavList), will provide
209+
clear structure to the page that is not present by default in `PageLayout.Pane`.
210+
211+
It's important to note that multiple landmark roles, such as multiple
212+
`<nav>` elements, should be uniquely labelled in order to clarify what the
213+
navigation container is used for.
214+
215+
```jsx live
216+
<PageLayout>
217+
<PageLayout.Header>
218+
<Placeholder label="Header" height={64} />
219+
</PageLayout.Header>
220+
<PageLayout.Pane position="start" aria-label="Secondary navigation">
221+
<NavList>
222+
<NavList.Item href="/" aria-current="page">
223+
Home
224+
</NavList.Item>
225+
<NavList.Item href="/about">About</NavList.Item>
226+
<NavList.Item href="/contact">Contact</NavList.Item>
227+
</NavList>
228+
</PageLayout.Pane>
229+
<PageLayout.Content>
230+
<Placeholder label="Content" height={240} />
231+
</PageLayout.Content>
232+
<PageLayout.Footer>
233+
<Placeholder label="Footer" height={64} />
234+
</PageLayout.Footer>
235+
</PageLayout>
236+
```
237+
205238
### With `aria-label`
206239

207240
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.
@@ -262,6 +295,20 @@ Each component may be labeled through either `aria-label` or `aria-labelledby` i
262295
- [WCAG, ARIA11 Technique](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA11)
263296
- [MDN, Landmark roles](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/landmark_role)
264297

298+
### `PageLayout.Pane`
299+
300+
The `PageLayout.Pane` component does not provide a default landmark role as the
301+
content of this component may have different roles. When using this component,
302+
consider the type of content being rendered inside of `PageLayout.Pane` and if
303+
it requires a landmark role. Common landmark roles include:
304+
305+
- [`aside`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/aside)
306+
- [`navigation`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/aside)
307+
308+
Some components, such as `NavList` may already include a landmark role. In these
309+
situation, these components use an appropriate landmark role and no further
310+
action is needed when using `PageLayout.Pane`.
311+
265312
### Screen readers
266313

267314
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.

0 commit comments

Comments
 (0)