SideNavigation

Use SideNavigation for side navigation on a page or section.

This component is in the alpha phase and is still under development. The component will support three nested levels and accessibility keyboard navigation. The component will change behavior and the API might also change in future component version releases.
Figma:

Web:

iOS:

Android:

A11y:

Props

Component props
Name
Type
Default
accessibilityLabel
Required
string
-

String that clients such as VoiceOver will read to describe the element.

children
Required
React.Node
-

The content shown in SideNavigation. See subcomponents.

React.Node
-

Content to display at the bottom of SideNavigation. Open slot available to display other functionality required in the page. See the Footer variant to learn more.

header
React.Node
-

Content to display at the top of SideNavigation. Open slot used for controlling the display of navigation items. See the Header variant to learn more.

showBorder
boolean
-

Displays a border in SideNavigation. See the Border variant for more info.

Accessibility

Active item

SideNavigation.Item has an "active" state that visually identifies it. To set SideNavigation.Item to active pass "page" (page redirect) or "section" (selected content section). Use routing hooks from React.Router or other frameworks to identify the current route. For example, if the current pathname matches the SideNavigation.Item href, set SideNavigation.Item to "page".

Localization

Be sure to localize the accessibilityLabel in SideNavigation and all subcomponents as well. Note that localization can lengthen text by 20 to 30 percent.

Subcomponents

SideNavigation.Section

Use SideNavigation.Section to create hierarchy within a single SideNavigation

SideNavigation.Section Props

SideNavigation.Section subcomponent props
Name
Type
Default
children
Required
React.Node
-

Any SideNavigation.Item to be rendered

label
Required
string
-

Label for the section. See the Sections variant for more info.

SideNavigation.Item

Use SideNavigation.Item for navigation, when the SideNavigation item navigates to a new page or sectoin.

SideNavigation.Item Props

SideNavigation.Item subcomponent props
Name
Type
Default
href
Required
string
-

Directs users to the url when item is selected.

item
Required
{| label: string, value: string |}
-

Object detailing the label and value for this item.

onSelect
Required
({| event: | SyntheticMouseEvent<HTMLDivElement> | SyntheticKeyboardEvent<HTMLDivElement> | SyntheticMouseEvent<HTMLAnchorElement> | SyntheticKeyboardEvent<HTMLAnchorElement>, item: {| label: string, value: string, |}, |}) => void
-

Callback when the user selects an item using the mouse or keyboard.

active
"page" | "section"
-

When set to 'page' or 'section', it displays the item in "active" state. See the Accessibility guidelines to learn more.

badge
{| text: string, type?: "info" | "error" | "warning" | "success" | "neutral", |}
-

When supplied, will display a Badge next to the item's label. See the Badges variant to learn more.

counter
{| number: string, accessibilityLabel: string |}
-

When supplied, will display a counter. See the Counter variant to learn more.

icon
$Keys<typeof icons> | {| __path: string |}
-

When supplied, will display Icon. See the Icon variant to learn more.

notificationAccessibilityLabel
string
-

When supplied, will display a notification dot. See the Notification variant to learn more.

Variants

Sections

Badge

Border

Icons

Gestalt icon
Custom icon

Notification

Counters