Skip to content
Alea0.1

Layout

AppShell

The app frame: a sticky header, a sidebar that turns into a drawer on small screens, the main area and a skip link.

Ant Design: Layout, Menu (inline)

import { AppShell, SidebarNav, SidebarGroup, SidebarLink } from '@alea/ui';

Examples

AppShell

Header, sidebar and content. Narrow the window: the sidebar moves into a drawer behind the menu button.

Skip to content
Fun Lab Pro

Palettes

Three palettes in this file.

Props

AppShell props

The app frame: sticky header, sidebar, scrollable content and a skip link (Ant's Layout).

PropTypeDefaultDescription
brandReactNode-Logo or product name, top left.
classNamestring-Extra class names for the root element.
collapseBelownumber900Below this width the sidebar goes into a drawer. Default 900 px.
headerEndReactNode-Things on the right of the header: search, theme toggle, avatar.
mainAs"div" | "main"'main'The content element: main (default), or div when the shell sits inside a page that already has a main (demos, embeds).
sidebarReactNode-The side navigation (a SidebarNav). On small screens it moves into a drawer.
sidebarWidthnumber248Sidebar width. Default 248 px.

SidebarNav props

Vertical navigation with groups; the current page is marked.

PropTypeDefaultDescription
aria-labelstring-Name of the navigation. Default "Sidebar".
classNamestring-Extra class names for the root element.

SidebarGroup props

PropTypeDefaultDescription
childrenrequiredReactNode-The SidebarLinks.
titleReactNode-Small uppercase title of the group.

Accessibility

  • Header, navigation and main are landmarks; the skip link jumps to main.
  • The current page is marked with aria-current.
  • On small screens the sidebar opens in a drawer that traps focus and closes on Escape.

Keyboard

KeyDoes
Tab (first)Shows the skip link
EscapeCloses the mobile navigation

Do and don't

Do

  • Group links under short titles.
  • Mark the current page with isCurrent.

Don't

  • Don't nest more than two levels in the sidebar: use a Tree or a page.
Tested with axe, keyboard and screen reader roles