Skip to content

Commit 53713b2

Browse files
authored
Deprecate SideNav in favor of NavList (#2120)
* Deprecate SideNav * Create small-donkeys-provide.md
1 parent 4f6e159 commit 53713b2

File tree

4 files changed

+63
-4
lines changed

4 files changed

+63
-4
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
"@primer/react": patch
3+
---
4+
5+
Deprecate SideNav in favor of [NavList](https://primer.style/NavList).
6+
7+
## Before
8+
9+
```jsx
10+
<SideNav aria-label="Main">
11+
<SideNav.Link href="/" selected>
12+
Home
13+
</SideNav.Link>
14+
<SideNav.Link href="/about">About</SideNav.Link>
15+
<SideNav.Link href="/contact">Contact</SideNav.Link>
16+
</SideNav>
17+
```
18+
19+
## After
20+
21+
```jsx
22+
<NavList aria-label="Main">
23+
<NavList.Item href="/" aria-current="page">
24+
Home
25+
</NavList.Item>
26+
<NavList.Item href="/about">About</NavList.Item>
27+
<NavList.Item href="/contact">Contact</NavList.Item>
28+
</NavList>
29+
```

docs/content/SideNav.md renamed to docs/content/deprecated/SideNav.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,38 @@
11
---
22
componentId: side_nav
33
title: SideNav
4-
status: Alpha
4+
status: Deprecated
55
---
66

7-
The Side Nav is a vertical list of navigational links, typically used on the left side of a page. For maximum flexibility, **SideNav elements have no default width or positioning.**
7+
The Side Nav is a vertical list of navigational links, typically used on the left side of a page. For maximum flexibility, SideNav elements have no default width or positioning.
8+
9+
## Deprecation
10+
11+
Use [NavList](/NavList) instead.
12+
13+
**Before**
14+
15+
```jsx
16+
<SideNav aria-label="Main">
17+
<SideNav.Link href="/" selected>
18+
Home
19+
</SideNav.Link>
20+
<SideNav.Link href="/about">About</SideNav.Link>
21+
<SideNav.Link href="/contact">Contact</SideNav.Link>
22+
</SideNav>
23+
```
24+
25+
**After**
26+
27+
```jsx
28+
<NavList aria-label="Main">
29+
<NavList.Item href="/" aria-current="page">
30+
Home
31+
</NavList.Item>
32+
<NavList.Item href="/about">About</NavList.Item>
33+
<NavList.Item href="/contact">Contact</NavList.Item>
34+
</NavList>
35+
```
836

937
## Default example
1038

docs/src/@primer/gatsby-theme-doctocat/nav.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@
116116
url: /Select
117117
- title: SelectPanel
118118
url: /SelectPanel
119-
- title: SideNav
120-
url: /SideNav
119+
121120
- title: Spinner
122121
url: /Spinner
123122
- title: StateLabel
@@ -184,3 +183,5 @@
184183
url: /deprecated/Position
185184
- title: SelectMenu
186185
url: /deprecated/SelectMenu
186+
- title: SideNav
187+
url: /deprecated/SideNav

src/SideNav.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,4 +187,5 @@ SideNavLink.displayName = 'SideNav.Link'
187187
export type SideNavProps = ComponentProps<typeof SideNav>
188188
export type SideNavLinkProps = ComponentProps<typeof SideNavLink>
189189

190+
/** @deprecated Use [NavList](https://primer.style/react/NavList) instead */
190191
export default Object.assign(SideNav, {Link: SideNavLink})

0 commit comments

Comments
 (0)