AppShell

Top-level application chrome. Composes top bar (global chrome only) + sidebar + main content area. Universal across all 6 TimelyCare products — no per-product variants. The AppShell-vs-PageHeader ownership rule is enforced via the typed AppShellTopBar sub-component, which has slots only for global chrome (logo, search, notifications, user menu, optional global actions) and NO slots for page chrome (title, breadcrumb, page actions — those live in PageHeader inside children).

Spec · from metadata

When to use

  • •Every authenticated page in every TimelyCare product
  • •The outermost layout — wraps the entire route content
  • •When you need a left-rail nav + top bar + main content area
  • •Staff are emulating or viewing the app as another person, or previewing it: pass mode={<AppShellMode>} so the whole app is framed while the mode lasts

When not to use

  • •Public/marketing pages with no authenticated chrome — use a custom layout
  • •Email/print templates
  • •Nested as a child of another AppShell — only one per route
  • •A notice about one page or one record — that is an Alert in the page, not a mode frame
  • •An app-wide notice such as a maintenance window or an outage — that is an Alert; the frame is for a mode the person is in

Variants

PropValuesDefaultDescription
contentWidthdefaultfulldefaultHow wide page content may grow. 'default' caps it at 1280px (max-w-7xl), centred beside the sidebar, so the header, toolbar and table share one edge. 'full' removes the cap, the p-6 inset and the gap, for a workspace that fills the viewport edge to edge and lays out its own panes, such as a live visit.
tonewarninginfowarningThe mode frame's tone. 'warning' (amber) when what the person does is real — emulating, viewing as, acting on behalf of someone. 'info' when nothing they do is saved — a preview or a demo.

Anti-patterns

Avoid<AppShell
  topBar={
    <header>
      <h1>Members</h1>
      <BreadcrumbBar items={crumbs} />
      <Button>Add member</Button>
    </header>
  }
  ...
>
Prefer<AppShell
  topBar={<AppShellTopBar logo={<Logo />} userMenu={<UserMenu />} />}
  ...
>
  <PageHeader>
    <PageHeaderBreadcrumb><Breadcrumb>...</Breadcrumb></PageHeaderBreadcrumb>
    <PageHeaderContent>
      <PageHeaderHeading>Members</PageHeaderHeading>
      <PageHeaderActions><Button>Add member</Button></PageHeaderActions>
    </PageHeaderContent>
  </PageHeader>
  <MembersTable rows={rows} />
</AppShell>

AppShell top bar carries global chrome only; page titles, breadcrumbs, and page-specific actions live in PageHeader inside children. Using a raw <header> bypasses the typed AppShellTopBar that enforces this rule.

Avoid<AppShellTopBar
  logo={<Logo />}
  globalActions={<Button>Save changes</Button>}
  userMenu={<UserMenu />}
/>
Prefer<AppShellTopBar logo={<Logo />} userMenu={<UserMenu />} />
// ...elsewhere, inside the page:
<PageHeader>
  <PageHeaderContent>
    <PageHeaderHeading>Settings</PageHeaderHeading>
    <PageHeaderActions><Button>Save changes</Button></PageHeaderActions>
  </PageHeaderContent>
</PageHeader>

globalActions in AppShellTopBar is for actions always relevant app-wide (e.g. start a new visit from anywhere). Page-specific actions like Save Changes belong in PageHeader.actions.

Avoid<>
  <div className="flex items-center justify-between bg-tc-orange-600 px-4 py-2 text-white">
    <span>You're viewing as Jordan Alvarez (Student). Changes you make are real.</span>
    <Button size="xs" variant="secondary" onClick={stopEmulating}>Exit emulation</Button>
  </div>
  <AppShell topBar={...} sidebar={...}>...</AppShell>
</>
Prefer<AppShell
  topBar={...}
  sidebar={...}
  mode={
    <AppShellMode action={{ label: "Exit emulation", onClick: stopEmulating }}>
      You're viewing as Jordan Alvarez (Student). Changes you make are real.
    </AppShellMode>
  }
>
  ...
</AppShell>

A banner above the app scrolls away, looks like any other notice, pushes the fixed sidebar rail out of line, and here uses a raw palette colour with white text that fails contrast. The mode frame stays round all four sides of the app while it scrolls, uses the warning tokens, and announces the sentence once.

Accessibility

  • Min touch target48px
  • Screen readerThe app-shell-main slot renders the document's single <main> landmark — SidebarInset around it is a plain <div>, so no main is nested inside another. AppShellTopBar renders a <header> that sits outside main and is therefore an implicit banner landmark (no explicit role needed). The PageHeader inside main is the route's h1. Sidebar inherits accessibility from the Sidebar primitive; nav-group expanders expose aria-expanded. AppShellMode sits first in the DOM, outside main and the banner. Its visible sentence is aria-hidden; a visually hidden role="status" copy is filled shortly after mount, so the sentence is announced once, politely, and again only if it changes. The frame is aria-hidden decoration: the sentence carries the meaning, not the colour.
  • ContrastInherits color/contrast from background, foreground, and sidebar tokens. Active sidebar item uses primary tone; meets WCAG AA. The mode bar's text is warning-foreground on warning (4.94:1) or info-foreground on info (6.43:1 light); the exit is an outline Button on its own input-bg surface. Its focus ring is drawn in the tone's foreground colour; Button's default ring is about 1.1–2:1 on the bar.

Token bindings

TokenCategoryUsage
backgroundcolorApp shell root surface (bg-background)
foregroundcolorApp shell root text color (text-foreground)
sidebarcolorSidebar surface, and the top-bar surface composed from Header (bg-sidebar)
sidebar-foregroundcolorSidebar and top-bar text color
sidebar-accentcolorSidebar active/hover item background
sidebar-bordercolorSidebar and top-bar chrome borders
warningcolorMode bar, frame and inner stroke, tone="warning"
warning-foregroundcolorMode sentence on the warning bar, and the exit's focus ring
infocolorMode bar, frame and inner stroke, tone="info"
info-foregroundcolorMode sentence on the info bar, and the exit's focus ring
6 (24px) / 4 (16px)spacingMain padding (p-6) and top-bar padding (px-4 md:px-6)
16 (64px)spacingTop-bar height (inherited from Header primitive)
2 (8px) / 1 (4px)spacingMode frame width from md / on phones
rounded-lgradiusThe app's corners inside the mode frame (rounded-lg)
Recent changes
  • new

    SaveIndicator, a record's avatar, and the help button

    2026-11-05

  • new

    ToolPanel, and a nav that a workspace can close

    2026-11-05

  • breaking

    Page content stops at 1280px, centred

    2026-11-05

[!NOTE] Compound component — an opinionated composition of Helix primitives. Composes: Sidebar, Header, Button, Collapsible.

Import

import { AppShell, AppShellTopBar, AppShellMode, AppShellHelp } from "@timelycare/helix-ui"

Usage

<AppShell
  topBar={
    <AppShellTopBar
      logo={<Logo />}
      notifications={<NotificationBell />}
      userMenu={<UserMenu />}
    />
  }
  sidebar={
    <AppSidebar
      brand={<Logo />}
      items={navItems}
      activeItemId={currentRouteId}
      onItemClick={(id) => router.push(routes[id])}
    />
  }
>
  <PageHeader title="Members" />
  <DataTable columns={cols} data={rows} />
</AppShell>

Content width

Page content stops at 1280px (max-w-7xl), centred in the space beside the sidebar. The cap wraps the PageHeader and everything under it together, so the title, the toolbar and the table share one left edge, and a page never stretches across a large monitor. On a laptop or a 1920px monitor the cap barely engages; on a 2560px monitor the space past it splits evenly on both sides.

Don't add a max-w-* of your own to the page root to widen or re-centre the page. Narrower content keeps its own cap inside this one: a single-column form or settings page stops at max-w-2xl.

contentWidth="full" removes the cap, the p-6 inset and the gap between sections, so the page owns its edges. It is for a workspace that fills the viewport edge to edge, such as a live visit with its header, panes and side rail, never for a table that wants more room.

Closing the nav

A workspace can close the desktop nav while someone works in it, and reopen it on request: pass sidebarOpen and onSidebarOpenChange (or defaultSidebarOpen to leave the state to AppShell). Closed, the nav takes no width. Controls inside the page read and set it with useSidebar(). Ordinary pages keep the nav open; the workspace pattern is in helix-app-layouts.

Help button

Consumer apps and Provider float their help button at the bottom right (Admin and Campus put help in the sidebar instead; see helix-app-layouts). Pass help an AppShellHelp:

<AppShell topBar={…} sidebar={…} help={<AppShellHelp onClick={openHelp} />}>

It is provider's support button: 56px, round, primary, icon only, 24px from the corner. AppShell pins it over the page and deepens the page's bottom inset, so the last row of a table or a form's save bar can scroll out from under it. Don't position a button of your own: a fixed button with no inset sits on top of the last thing on the page.

The button is named by label, which is also its tooltip; the default is "Help". When it opens a panel, say which way it goes and swap the icon with it:

<AppShellHelp
  label={chatOpen ? "Close support chat" : "Open support chat"}
  icon={chatOpen ? <X /> : <MessageCircle />}
  onClick={toggleChat}
/>

A full-width workspace (contentWidth="full") doesn't get the inset, because it lays out its own panes. Put help among its tools there, as provider's in-visit screen does with its Support tool.

Mode frame

When the whole app is in a special mode, say so round the whole app. TimelyCare staff emulating or viewing the app as another person is the case it was built for: everything looks like that person's app, and anything they change is real. Pass mode an AppShellMode, and a tone frame runs round all four sides of the app. The frame's top edge holds one sentence and the way out. The app sits inside with rounded corners.

<AppShell
  topBar={<AppShellTopBar logo={<Logo />} userMenu={<UserMenu />} />}
  sidebar={<AppSidebar items={navItems} pathname={pathname} />}
  mode={
    emulating ? (
      <AppShellMode action={{ label: "Exit emulation", onClick: stopEmulating }}>
        You're viewing as {member.name} ({member.role}). Changes you make are real.
      </AppShellMode>
    ) : undefined
  }
>
  …
</AppShell>
  • One sentence: what the mode is, then what it means for the person. "You're viewing as Riley Park (Campus admin). Changes you make are real." Plain text, with no links or buttons in it.
  • Always a way out when the person can leave the mode: action={{ label, onClick }}. Helix draws it as an outline button at the end of the bar. Helix doesn't move focus when it is pressed: once the frame is gone, move focus somewhere sensible, such as the page heading.
  • Tone: warning (the default) when what the person does is real. info when nothing is saved, such as a preview. There is no red frame: a mode is not a failure. warning is Helix amber with dark text, not Campus orange: white on Campus orange fails AA.
  • Not a banner. A banner above the app scrolls away and reads like any other notice. The frame stays put while the page scrolls, and the sidebar and top bar sit inside it.
  • Announced once. Screen readers hear the sentence once, politely, when the mode starts, and again only if it changes. Don't also show a toast or an Alert for it.
  • Phones: the frame narrows to 4px and the sentence wraps. It is never cut off.
  • Your own sticky elements: while a mode is set, the bar's height is on the AppShell root as --app-shell-mode-bar. Anything of yours that sticks to the top of the window needs to sit below it, and anything that sticks to the bottom (a sticky action bar) needs bottom-1 md:bottom-2 so it clears the frame.

TimelyCare Design System

v0.14.0