---
title: SideNav
---

import LibraryInfo from '@theme/LibraryInfo'
import { Feedback, ExternalCodeBlock, TokensTable, PropsTable } from '../../src/components'
import { SideNav, FlexGrid, Box, Typography } from '@telus-uds/components-web'
import { SideNav as BaseDocs } from 'docs/@telus-uds/components-base'
import AvailableOnBoth from '../../partials/_platform-considerations-both.mdx'
import NoStylisticVariants from '../../partials/_variants-none.mdx'

# SideNav

<LibraryInfo figmaLink="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Ffile%2F4zJn2Qn6uXOqPP1GVDipy6%2F%25F0%259F%258D%2580-Allium-Components%3Fnode-id%3D762%253A143" />

```jsx live
<SideNav>
  <SideNav.Item href="#level-1-1">Level 1</SideNav.Item>
  <SideNav.ItemsGroup label="Group 1">
    <SideNav.Item href="#level-2-1">Level 2 - 1</SideNav.Item>
    <SideNav.Item href="#level-2-2">Level 2 - 2</SideNav.Item>
    <SideNav.Item href="#level-2-3">Level 2 - 3</SideNav.Item>
  </SideNav.ItemsGroup>
  <SideNav.Item href="#level-1-2">Level 1 - 2</SideNav.Item>
  <SideNav.ItemsGroup label="Group 2">
    <SideNav.Item href="#level-2-4">Level 2 - 4</SideNav.Item>
  </SideNav.ItemsGroup>
</SideNav>
```

## Introduction

A stacked, in-page navigation widget.

[Follow the appropriate instructions](importing-components) to add this component in to your app.

## Guidance

- Use in conjuntion with a large amount of educational / informational content
- Allow the user to navigate between options frequently and efficiently

SideNav is typically used alongside long text content that is broken down into sections.

<ExternalCodeBlock file="side-nav-with-content" scope={{ FlexGrid, Box, SideNav, Typography }} />

### `accordion` prop

By default, only one SideNav panel may be open.

If the `accordion` prop is passed as `false`, any number of panels may be open at a time.

```jsx live
<SideNav accordion={false}>
  <SideNav.Item href="#level-1-1">Level 1 - 1</SideNav.Item>
  <SideNav.ItemsGroup label="Group 1">
    <SideNav.Item href="#level-2-1">Level 2 - 1</SideNav.Item>
    <SideNav.Item href="#level-2-2">Level 2 - 2</SideNav.Item>
    <SideNav.Item href="#level-2-3">Level 2 - 3</SideNav.Item>
  </SideNav.ItemsGroup>
  <SideNav.Item href="#level-1-2">Level 1 - 2</SideNav.Item>
  <SideNav.ItemsGroup label="Group 2">
    <SideNav.Item href="#level-2-4">Level 2 - 4</SideNav.Item>
  </SideNav.ItemsGroup>
</SideNav>
```

### Accessibility

Expanded item groups are marked with `aria-expanded`, while the active item is has an `aria-selected` attribute.
Similar patterns are applied on the native platforms.

### Platform considerations

<AvailableOnBoth />

## Props

### SideNav

<PropsTable base={BaseDocs} />

### SideNav.Item

<PropsTable base={BaseDocs.Item} />

### SideNav.ItemsGroup

<PropsTable base={BaseDocs.ItemsGroup} />

## Tokens

<TokensTable
  base={BaseDocs}
  component="SideNav"
  tokensProps={['tokens', 'itemTokens', 'groupTokens']}
/>

## Variants

<NoStylisticVariants />

## Feedback

<Feedback component="SideNav" />
