Skip to main content AWT

Side nav

A side nav beside your content on wide screens. On small screens, its links move into the header menu. Add Side nav sections, links and dividers inside.

Live example

Side navigation is site chrome: it pins itself to the left edge of the screen, next to the header. An inline example here would sit on top of this page, so the screenshots below stand in for it.

How it renders

A side nav with two sections divided by a line: Getting started, with the links Installation and Your first page, and Guides, with the link Color schemes.
The block as it renders, with each state the example shows.

Dark mode you don’t have to build

Every block supports dark mode. Here is the Side nav block in the dark scheme.

The same side nav in the dark color scheme, with light text on a near-black background.
Your visitors pick the scheme; the block keeps its contrast.

Parameters

Everything the Side nav block accepts. Setting is the label you see in the block’s settings panel. Parameter is what the same value is called in code. Accepts is what you can put in it.

Side nav block parameters
SettingParameterTypeDefaultAcceptsWhat it does
Accessible name (aria-label)ariaLabelstring“Side navigation”Any textThe accessible name screen readers announce for this landmark or control.
Show the side navmodestring“persistent”persistent, noneShows the side navigation, or hides it. On small screens its links move into the header menu.
HTML IDidstring“side-nav”An element IDThe ID a toggle control uses to open and close this side nav.

Inside it: Side nav section

A group of side navigation links that opens and closes, with an optional heading.

Side nav section parameters
SettingParameterTypeDefaultAcceptsWhat it does
Typed on the blocktitlestringemptyAny textThe section heading.
IconiconNamestringemptyA Carbon icon nameAn optional Carbon icon next to the section title.

Inside it: Side nav link

One link in the side navigation.

Side nav link parameters
SettingParameterTypeDefaultAcceptsWhat it does
Typed on the blocktextstring“Link”Any textThe visible text.
Link URLhrefstring“#”A URLThe URL this points to.
IconiconNamestringemptyA Carbon icon nameThe name of a Carbon icon, for example download. The icon is decorative, so the text must still carry the meaning.
Always mark as the current pageisCurrentbooleanfalsetrue or falseMarks this item as the current page, visually and with aria-current.
Highlight this link whenmatchModestring“exact”exact, prefixHow the current page is detected from the URL: exact match, or prefix so child pages count too.

Inside it: Side nav divider

A line between groups of side navigation links.

It has no parameters of its own.

Accessibility parameters, on this and every AWT block

Every AWT block has an Accessibility panel in its settings. Each control in it becomes a real HTML attribute on the block’s outer element:

Accessibility parameters shared by every AWT block
SettingParameterWhat it does
Accessible name (aria-label)ariaLabelBecomes aria-label on the block’s outer element. Replaces the accessible name screen readers announce. Set it only when the visible label is not enough.
Described by (aria-describedby)ariaDescribedbyBecomes aria-describedby. Point it at the ID of another element on the page whose text adds a longer description.
Labelled by (aria-labelledby)ariaLabelledbyBecomes aria-labelledby. Point it at the ID of another element whose text should become this block’s accessible name.
RoleawtRoleBecomes the role attribute. Overrides the element’s ARIA role. The list offers only roles that suit the element.
Language (lang)awtLangBecomes the lang attribute. Set it when this block’s content is in a different language from the page, as a BCP-47 code like “fr”.