AppShell

June 7, 2026 · View on GitHub

Root application template. Composes Header + Sidebar + Main + Footer with four layout modes.

Contract

<kp-app-shell> is a thin structural wrapper: it arranges the chrome of your app (topbar, side nav, optional banner, optional footer) and a scrolling content area. Everything visible is a projection slot — you pass real <kp-header>, <kp-sidebar>, <kp-banner>, etc. instances.

The shell owns placement, not content. Persisting sidebar expand state, routing, and responsive breakpoints are the consumer's job.

API

Inputs

NameTypeDefaultDescription
layout'sidebar-left' | 'sidebar-right' | 'no-sidebar' | 'sidebar-collapsed''sidebar-left'Sidebar placement / hide
showHeaderbooleantrue
showSidebarbooleantruePair with layout !== 'no-sidebar'
showFooterbooleanfalse
showBannerbooleanfalseStrip under the header

Projection slots

SelectorSlot
[kpAppShellHeader]Topbar (use <kp-header>)
[kpAppShellBanner]Optional global strip under the header
[kpAppShellSidebar]Side navigation (use <kp-sidebar>)
[kpAppShellBody]Main scrolling content
[kpAppShellFooter]Optional footer strip

Layouts

ValueUsage
sidebar-leftDefault SaaS layout.
sidebar-rightChat / activity-centric apps where the side list is supplementary.
no-sidebarMarketing pages, simple apps (header + content).
sidebar-collapsedDense mode — sidebar at 64px.

Do / Don't

Do

  • Wire the Sidebar toggle output to layout switching between sidebar-left and sidebar-collapsed (and persist) if you want a stable collapse state.
  • Disable duplicated chrome inside the Sidebar when the Header already carries it: [showLogo]="false" + [showUserFooter]="false". The Sidebar collapses its top/footer frames accordingly.
  • Use kpAppShellBanner for ephemeral system messages (trial expiring, maintenance). Not for navigation.
  • Keep the body scrollable — the shell's grid does this for you. Don't wrap body content in overflow: hidden containers.

Don't

  • Don't stack two AppShells (e.g. per-route). The shell is the app root — route under [kpAppShellBody].
  • Don't hide the header unless the page is intentionally immersive (PageError, LoginPage). Those use dedicated patterns instead.

References

Changelog

  • 0.1.0 — Initial release. 4 layouts, banner + footer slots.