SideNav
- Deprecated
- Not reviewed for accessibility
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.
Use NavList instead.
<SideNav aria-label="Main"><SideNav.Link href="/" selected>Home</SideNav.Link><SideNav.Link href="/about">About</SideNav.Link><SideNav.Link href="/contact">Contact</SideNav.Link></SideNav>
<NavList aria-label="Main"><NavList.Item href="/" aria-current="page">Home</NavList.Item><NavList.Item href="/about">About</NavList.Item><NavList.Item href="/contact">Contact</NavList.Item></NavList>
Different kinds of content can be added inside a SideNav item. Use system props to further style them if needed.
Add the variant='full'
prop to a SideNav.Link
to spread child elements across the link, which is useful for status icons, labels, and the like.
Add the variant="lightweight"
prop to SideNav
to render an alternative, more lightweight version that has items with no borders and are more condensed.
It can also appear nested, as a sub navigation. Use margin/padding System Props to add indentation.
If using React Router, you can use the as
prop to render the element as a NavLink
. React Router will automatically handle setting aria-current="page"
for you.
<SideNav.Link as={NavLink} to="...">...</SideNav.Link>
Name | Type | Default | Description |
---|---|---|---|
as | String | 'nav' | Sets the HTML tag for the component. |
bordered | Boolean | false | Renders the component with a border. |
variant | String | 'normal' | Set to lightweight to render in a lightweight style. |
sx | SystemStyleObject | {} | Style to be applied to the component |
Name | Type | Default | Description |
---|---|---|---|
as | String | 'a' | Sets the HTML tag for the component. |
href | String | URL to be used for the Link | |
muted | Boolean | false | Uses a less prominent shade for Link color, and the default link shade on hover |
selected | Boolean | false | Sets the link as selected, giving it a different style and setting the aria-current attribute. |
underline | Boolean | false | Adds underline to the Link |
variant | String | 'normal' | Set to full to render a full variant, suitable for including icons and labels. |
sx | SystemStyleObject | {} | Style to be applied to the component |