Chapter 07 Navigation
Navigation
The app's main links, in a side bar. A named navigation landmark, links at least 44px tall, and the current page marked with a bar and bold text, not only a fill. On a phone, put the same links in a drawer.
import { NavComponent } from '@okaapi-ui/angular';
// Mark the current link with routerLinkActive ariaCurrentWhenActive="page".A side bar
<ui-nav label="Main">
<h2 class="ui-nav__title ui-label">Sales</h2>
<ul>
<li><a routerLink="/orders" routerLinkActive ariaCurrentWhenActive="page">Orders</a></li>
<li><a routerLink="/invoices" routerLinkActive ariaCurrentWhenActive="page">Invoices</a></li>
</ul>
</ui-nav>In Arabic
<ui-nav label="الرئيسية">…</ui-nav>When to use something else
| If you need | Use |
|---|---|
| A whole app layout with header and side bar | App shell |
| Views of one page | Tabs |
| Where the page sits in the site | Breadcrumbs |
Inputs
| Name | Type | Default | What it does |
|---|---|---|---|
label | string | — | Required. Names the landmark, so it differs from other navigation. |
content | ul, h2 | — | Lists of links, with optional group titles. |
Keyboard and screen readers
- A named navigation landmark; the current page is marked for screen readers and with a bar and bold text.