Skip to content
GitHub (opens in a new tab)

App shell

Side nav with a workspace switcher, quick actions and a Notifications panel around the page, inset or flat, with a narrow drawer.

Install

Not exported from agentic-ds-kit. add copies the source into your app (components/patterns/app-shell/) with this contract beside it. You own the copy: replace the demo data, rearrange or drop sections, and keep the must lines.

npx agentic-ds-kit add app-shell

Usage

import { AppShellPattern } from "@/components/patterns/app-shell";

<AppShellPattern
  className="layout-shell--viewport"
  nav={{ title: "Acme", items }}
  workspace={{ name: "Acme", mark: "Receipt", menu: workspaces, onSelect: switchTo }}
  search={{ groups: commands, onSelect: go }}
  notifications={{
    tabs: [
      { id: "notifications", label: "Notifications", items: notifications },
      { id: "requests", label: "Requests", items: requests },
    ],
    onItemClick: open,
    onSettings: openSettings,
  }}
  projects={{ items: projects, onNew: createProject }}
  account={{ name: "Rin Okafor", secondary: "Operations lead", menu: accountMenu, onSelect }}
>
  <main className="layout-canvas">…</main>
</AppShellPattern>

What a copy keeps

The contract’s must lines: the kit look and accessibility. Ask before breaking one.

  • Semantic tokens only (agentic-ds-kit/tokens.css); no raw hex, no primitive --color-* ramps
  • At most one appearance="solid" mode="primary" Button per view; the shell has none, pages own theirs
  • Do not restyle kit components; change them through their props, slots, and tokens
  • Render inside a main landmark (wrap the pattern, or your page content, in <main>); header and nav chrome, if any, use AppHeader / SideNav (or other header / nav landmarks) and nav stays reachable on small screens
  • Overlays are kit Drawer or Modal (focus trap, Escape, scrim, focus return built in); no local scrim, sheet, or fixed overlay, and SideNav itself is never an overlay
  • Breakpoints follow --grid-breakpoint-md: matchMedia reads the token; media queries cannot read var(), so CSS repeats 64rem with a comment naming the token
  • A custom header places AppShellMenuButton (accessible name and focus return built in); without it narrow screens cannot reach the nav

Defaults you can change

  • layout inset; the rail expanded; the work panel closed
  • Narrow screens: the nav moves into a left kit Drawer behind a Menu Button; another pattern is fine as long as the nav stays reachable
  • The Menu Button sits at the start of AppHeader, in the brand cell on the rail axis
  • Below the breakpoint there is no fixed SideNav or collapsed rail; the Drawer holds the nav
  • Chrome is layout-shell (AppHeader, radius none) over layout-app (SideNav, no header). Flat: SideNav radius none, no gap. Inset: the rail is a radius md panel, and the rail and page panel sit space-inset-md in from every edge and space-inset-md apart
  • Without header: side nav only when wide (SideNav brand header on), top bar only when narrow
  • layout-shell--viewport on className when the shell is the whole page
  • One layout option among many: top bar only, side nav only, both, or neither are all fine
  • Collapse is remembered in sessionStorage (key agentic-ds-kit:app-shell:collapsed) for the browser session
  • No top bar when wide in the examples: the nav carries the workspace switcher, quick actions and Notifications, so the page starts at the top inset

Built from

  • Pattern
    →

    Onboarding

    Four setup steps (business, plan, billing, review) with progress, a validation error and a creating state.

  • Component
    →

    Drawer

    Edge panel for secondary tasks.

  • Component
    →

    DocsNav

    Docs and catalog sidebar only: title, grouped text-only links, optional decorative icons and muted counts on group and subgroup headers only, an active page pill and optional footer links.

  • Component
    →

    AppHeader

    Product top chrome: brand mark on the start, centered kit Input search, trailing actions.