Skip to content
Okaapiأوكابي
Framework for the code
Theme
Okaapi on GitHub

Chapter 08 Layout

App shell

The frame every screen of an app sits in: a header across the top, the main links in a side bar, the page beside them. When the shell is narrower than 64rem the side bar folds behind a menu button and opens over the page. Escape, the shade, or following a link closes it again.

Use it in Angular
import { AppShellComponent, NavComponent } from '@okaapi-ui/angular';
// Put it once, in the root component, around the router outlet.

An app

This preview is narrower than 64rem, so the side bar starts folded. Press Menu. On a wide screen it stays open beside the page.

Orders

Twelve new orders since this morning.

Angular
<a class="doc-skip" href="#main">Skip to content</a>
<ui-app-shell>
  <a uiShellBrand class="ui-shell__brand" routerLink="/">Okaapi</a>
  <ui-language-switcher uiShellActions [languages]="languages" />
  <ui-nav uiShellSidebar label="Main">
    <ul>
      <li><a routerLink="/orders" routerLinkActive ariaCurrentWhenActive="page">Orders</a></li>
      <li><a routerLink="/invoices" routerLinkActive ariaCurrentWhenActive="page">Invoices</a></li>
    </ul>
  </ui-nav>
  <router-outlet />
</ui-app-shell>

In Arabic

الطلبات

اثنا عشر طلبًا جديدًا منذ الصباح.

Angular
<ui-app-shell menuLabel="القائمة">…</ui-app-shell>

When to use something else

If you needUse
Links in a side bar only, inside your own layoutNavigation
Show where the page sits in the siteBreadcrumbs

Inputs

NameTypeDefaultWhat it does
menuLabelstringMenu from labelsNames the menu button. Translate it.
mainIdstringmainThe id of the page area, for a "Skip to content" link.
landmarksbooleantrueThe header is the banner and the page the main landmark. Off inside a page that has them.
[uiShellBrand] | [uiShellActions] | [uiShellSidebar]slot — Brand at the start of the header, actions at its end, links in the side bar. The rest is the page.

Keyboard and screen readers

KeysWhat they do
Enter or Space On the menu button, open the side bar on a narrow screen.
Escape Close the side bar.
  • The header, the side bar and the page are landmarks, so screen readers can jump between them.