Navigation
Side navigation
The column of sections on the side of an application. nav.kui-sidenav holds links with icons, headings and collapsible sections as native <details>. Wrapped in <kui-sidenav> it can collapse to its icons.
Inside .kui-app the side navigation stands left of the main column from 768 pixels up and is hidden on a phone, where the tab bar or the top bar's menu carries the same links. The navigation scrolls on its own when it is taller than the window.
Examples
Links, headings, a section and the collapse button
Press the button at the bottom to collapse the navigation to its icons. The choice is kept in this browser under the key in the remember attribute. While collapsed, each link shows its name as a tooltip.
<kui-sidenav remember="docs-sidenav-demo">
<nav class="kui-sidenav" aria-label="Workspace">
<ul class="kui-sidenav__list">
<li><a class="kui-sidenav__link" href="#sidenav-inbox" aria-current="page"><svg class="kui-icon" aria-hidden="true"><use href="kit/icons.svg#inbox"></use></svg><span class="kui-sidenav__label">Inbox</span><span class="kui-sidenav__count">12</span></a></li>
<li><a class="kui-sidenav__link" href="#sidenav-tasks"><svg class="kui-icon" aria-hidden="true"><use href="kit/icons.svg#list-checks"></use></svg><span class="kui-sidenav__label">Tasks</span><span class="kui-sidenav__count">4</span></a></li>
<li><a class="kui-sidenav__link" href="#sidenav-cal"><svg class="kui-icon" aria-hidden="true"><use href="kit/icons.svg#calendar"></use></svg><span class="kui-sidenav__label">Calendar</span></a></li>
</ul>
<p class="kui-sidenav__heading">Clients</p>
<details open>
<summary><svg class="kui-icon" aria-hidden="true"><use href="kit/icons.svg#briefcase"></use></svg><span class="kui-sidenav__label">Predmeti</span></summary>
<ul class="kui-sidenav__list">
<li><a class="kui-sidenav__link" href="#sidenav-c1"><span class="kui-sidenav__label">Petrović protiv Jovanovića</span></a></li>
<li><a class="kui-sidenav__link" href="#sidenav-c2"><span class="kui-sidenav__label">Nasleđe Živković</span></a></li>
<li><a class="kui-sidenav__link" href="#sidenav-c3"><span class="kui-sidenav__label">Ugovor o zakupu, Čačak</span></a></li>
</ul>
</details>
<ul class="kui-sidenav__list">
<li><a class="kui-sidenav__link" href="#sidenav-docs"><svg class="kui-icon" aria-hidden="true"><use href="kit/icons.svg#files"></use></svg><span class="kui-sidenav__label">Documents</span></a></li>
<li><a class="kui-sidenav__link" href="#sidenav-settings"><svg class="kui-icon" aria-hidden="true"><use href="kit/icons.svg#settings"></use></svg><span class="kui-sidenav__label">Settings</span></a></li>
</ul>
<button class="kui-button kui-button--icon kui-button--ghost kui-sidenav__toggle" type="button" aria-label="Collapse the navigation" aria-expanded="true"><svg class="kui-icon" aria-hidden="true"><use href="kit/icons.svg#chevrons-left"></use></svg></button>
</nav>
</kui-sidenav>
Collapsed
Start collapsed with data-collapsed on the nav. The labels stay in the page for screen readers; only the icons are shown. A section's summary keeps its icon; expanding the navigation shows its pages again.
<kui-sidenav>
<nav class="kui-sidenav" aria-label="Workspace, collapsed" data-collapsed>
<ul class="kui-sidenav__list">
<li><a class="kui-sidenav__link" href="#sidenav-k-inbox" aria-current="page"><svg class="kui-icon" aria-hidden="true"><use href="kit/icons.svg#inbox"></use></svg><span class="kui-sidenav__label">Inbox</span></a></li>
<li><a class="kui-sidenav__link" href="#sidenav-k-tasks"><svg class="kui-icon" aria-hidden="true"><use href="kit/icons.svg#list-checks"></use></svg><span class="kui-sidenav__label">Tasks</span></a></li>
<li><a class="kui-sidenav__link" href="#sidenav-k-cal"><svg class="kui-icon" aria-hidden="true"><use href="kit/icons.svg#calendar"></use></svg><span class="kui-sidenav__label">Calendar</span></a></li>
<li><a class="kui-sidenav__link" href="#sidenav-k-set"><svg class="kui-icon" aria-hidden="true"><use href="kit/icons.svg#settings"></use></svg><span class="kui-sidenav__label">Settings</span></a></li>
</ul>
<button class="kui-button kui-button--icon kui-button--ghost kui-sidenav__toggle" type="button" aria-label="Expand the navigation" aria-expanded="false"><svg class="kui-icon" aria-hidden="true"><use href="kit/icons.svg#chevrons-left"></use></svg></button>
</nav>
</kui-sidenav>
States
Every state
The current page has the accent fill and a line on its left (aria-current="page"). Hover gives a soft fill; focus shows the ring. A long name wraps inside the column. A count sits at the end of the row in small, faint figures.
<nav class="kui-sidenav" aria-label="States">
<ul class="kui-sidenav__list">
<li><a class="kui-sidenav__link" href="#sidenav-s1" aria-current="page"><svg class="kui-icon" aria-hidden="true"><use href="kit/icons.svg#house"></use></svg><span class="kui-sidenav__label">Current page</span></a></li>
<li><a class="kui-sidenav__link" href="#sidenav-s2"><svg class="kui-icon" aria-hidden="true"><use href="kit/icons.svg#folder"></use></svg><span class="kui-sidenav__label">Default</span><span class="kui-sidenav__count">128</span></a></li>
<li><a class="kui-sidenav__link" href="#sidenav-s3"><svg class="kui-icon" aria-hidden="true"><use href="kit/icons.svg#file-text"></use></svg><span class="kui-sidenav__label">Grundsteuererklärungsformulare</span></a></li>
<li><a class="kui-sidenav__link" href="#sidenav-s4"><svg class="kui-icon" aria-hidden="true"><use href="kit/icons.svg#users"></use></svg><span class="kui-sidenav__label">Клијенти и сарадници</span></a></li>
</ul>
<details>
<summary><svg class="kui-icon" aria-hidden="true"><use href="kit/icons.svg#archive"></use></svg><span class="kui-sidenav__label">A closed section</span></summary>
<ul class="kui-sidenav__list">
<li><a class="kui-sidenav__link" href="#sidenav-s5"><span class="kui-sidenav__label">2025</span></a></li>
</ul>
</details>
</nav>
Classes and attributes
nav.kui-sidenav- The column. Give it an aria-label. Sticky, as tall as the window at most, and it scrolls on its own.
.kui-sidenav__list- A list of links (ul).
.kui-sidenav__link- One link: an icon, a .kui-sidenav__label and an optional .kui-sidenav__count. aria-current="page" marks the current one.
.kui-sidenav__heading- A small heading over a group of links.
details > summary- A section that opens and closes; its list is indented under the summary.
.kui-sidenav__toggle- The button that collapses and expands; needs kui-sidenav.
data-collapsed- On the nav: only the icons show. kui-sidenav sets and clears it.
kui-sidenav remember="KEY"- Keeps the collapsed choice in this browser under KEY.
--kui-sidenav-width- The open width; set it on the nav to change it.
--inline- The same links without the column’s frame, width and scrolling: for a drawer or a panel.
Keyboard
- Tab
- Moves through the links, the section summaries and the toggle.
- Enter or Space
- On a summary, opens or closes the section; on the toggle, collapses or expands.
- Enter
- Follows a link.
Accessibility
- The column is a
<nav>with an aria-label, so it is a named navigation landmark. - The toggle says what it does in its keyed name (“Collapse the navigation”, “Expand the navigation”) and its state in aria-expanded.
- While collapsed the labels are hidden only from the eye; screen readers still read every link’s name, and each link gets a title for the tooltip.
- Every icon is aria-hidden; the label is the name.
- Sections are native
<details>, so the browser announces whether a section is expanded.
Do and do not
Do
- Give every top-level link an icon, so the collapsed column still says something.
- Keep the sections a person uses every day at the top.
- Mark the current page, also inside a closed section, and open that section.
Do not
- Do not nest sections more than one level.
- Do not put actions (Delete, Export) in the navigation: it is for going somewhere.
- Do not show the side navigation on a phone; use the tab bar or the top bar’s menu.