Skip to content

AppShell ​

The layout of every Keston app page: the shared Header on top, the app's Sidebar on the left, the page in the middle.

Open in Storybook to try every prop.

When to use ​

  • As the root of every app, so all apps share the same header, account menu and responsive behaviour. Each app supplies only its title, sidebar items and pages.

When not to use ​

  • Sign-in, error or marketing pages that have no navigation.

Anatomy ​

PartRequiredNotes
skip linkYes"Skip to content", visible only when focused.
headerYesHeader: sticky, with menu button and account menu. The menu button opens the mobile menu (narrow) or collapses the sidebar (wide).
sidebarYesSidebar beside the page (wide) or in a left Slideover (narrow).
mainYesThe page. Default slot.

Properties ​

PropertyTypeDefaultDescription
titlestring—App name, in the header and as the mobile menu's title.
userHeaderUser—Signed-in user, for the account menu.
userActionsHeaderUserAction[]allAccount menu actions.
signInbooleantrueShow Sign in when signed out.
items / sectionsSidebarItem[] / SidebarSection[][]Sidebar contents.
collapsiblebooleantrueWide screens: the header's menu button collapses the sidebar.
collapsedboolean (v-model)falseSidebar collapsed to icons.
menuOpenboolean (v-model)falseMobile menu open.
linkComponentstring | Component"a"For sidebar items with to.
header / sidebarobject—Other Header / Sidebar props.

Events: account-settings, switch-account, log-out, sign-in.

Spacing and layout ​

  • Breakpoint: lg (64rem). Below it the sidebar moves into a Slideover (max width spacing 72).
  • The page scrolls, not an inner box: the header sticks at the top, the sidebar sticks below it at full remaining height.
  • Page padding is the page's own (e.g. ui.main: 'p-6').

Behaviour ​

  • Narrow: menu button opens the menu. Choosing an item, or the screen becoming wide, closes it.
  • Wide: sidebar collapse state is kept by v-model:collapsed (the app can store it).

Accessibility ​

  • Landmarks: header (banner), nav (inside the sidebar), main.
  • Skip link moves focus to main.
  • Mobile menu is a dialog titled with the app name.

Platform adaptation ​

PlatformImplementationDifferences
Web / desktop (Vue)AppShell.vue—
iOS (SwiftUI)—NavigationSplitView (iPad), TabView (iPhone).
Android (Compose)—Scaffold with TopAppBar and NavigationDrawer / Rail.

Tokens used ​

TokenUsed for
color backgroundpage background

Do / Don't ​

DoDon't
Use one AppShell at the root of each app.Rebuild the header per app. Use slots for app-specific additions.

Released under the PolyForm Noncommercial License 1.0.0.