Skip to content

Commit a892511

Browse files
committed
Merge branch 'main' into develop
2 parents 0c21334 + a58a4c5 commit a892511

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

website/src/pages/skip-nav.mdx

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,30 @@ Renders a link that remains hidden until focused to skip to the main content.
6464

6565
#### SkipNavLink Props
6666

67-
| Prop | Type | Required |
68-
| -------------------------------------- | ------ | -------- |
69-
| [`a` props](#skipnavlink-anchor-props) | Cool | |
70-
| [`children`](#skipnavlink-children) | `node` | false |
67+
| Prop | Type | Required | Default |
68+
| -------------------------------------- | ------- | -------- | ---------------- |
69+
| [`a` props](#skipnavlink-anchor-props) | Cool | | n/a |
70+
| [`contentId`](#skipnavlink-contentid) | `string`| false | 'reach-skip-nav' |
71+
| [`children`](#skipnavlink-children) | `node` | false | n/a |
7172

7273
##### SkipNavLink anchor props
7374

7475
Element props are spread to the underlying link.
7576

77+
#### SkipNavLink `contentId`
78+
79+
You can pass an id that connects the skip link to the element where it should link to. You can use this instead of using `SkipNavContent`. For example:
80+
81+
```jsx
82+
<SkipNavLink contentId="main" />
83+
<div>
84+
<YourNav />
85+
<main id="main">
86+
//...
87+
</main>
88+
</div>
89+
```
90+
7691
##### SkipNavLink `children`
7792

7893
`children?: React.ReactNode`

0 commit comments

Comments
 (0)