PageShell
Page container with a header for dashboard screens
pnpm add @wandercom/design-system-web
PageShell is the container that holds a dashboard page. It has an optional header with a title or breadcrumbs on the left and an action group on the right, a body that scrolls inside the container, and an optional footer for step actions. It doesn't include the side nav or the inset around the shell; the surrounding layout owns those.
import {
PageShell,
PageShellActions,
PageShellBody,
PageShellHeader,
PageShellMoreMenu,
PageShellTitle,
} from '@wandercom/design-system-web/blocks/page-shell';
import { Button } from '@wandercom/design-system-web/ui/button';
import { DropdownItem } from '@wandercom/design-system-web/ui/dropdown';
export function Example() {
return (
<div className="h-dvh bg-surface-secondary py-4 pr-4">
<PageShell>
<PageShellHeader>
<PageShellTitle>Calendar</PageShellTitle>
<PageShellActions>
<PageShellMoreMenu>
<DropdownItem>Export</DropdownItem>
</PageShellMoreMenu>
<Button size="sm">Today</Button>
</PageShellActions>
</PageShellHeader>
<PageShellBody>…</PageShellBody>
</PageShell>
</div>
);
}The parts are also available as PageShell.Header, PageShell.Title, PageShell.Back, PageShell.Breadcrumbs, PageShell.Actions, PageShell.MoreMenu, PageShell.Body, PageShell.Footer, PageShell.FooterStart and PageShell.FooterEnd.
The action group holds an optional ••• menu and at most one primary button. Put any other actions in the menu.
<PageShellHeader>
<PageShellBreadcrumbs>
<BreadcrumbItem>
<BreadcrumbLink href="/finances">
<IconMoney aria-hidden="true" className="size-4" />
Finances
</BreadcrumbLink>
<BreadcrumbSeparator />
</BreadcrumbItem>
<BreadcrumbItem>
<BreadcrumbPage>Earnings</BreadcrumbPage>
</BreadcrumbItem>
</PageShellBreadcrumbs>
</PageShellHeader>Leave out PageShellHeader for pages that use an in-page toolbar instead.
The body scrolls inside the shell, and a divider appears under the header once it scrolls. The body listens in the capture phase, so scrolling a nested scroll area inside it also shows the divider. The body is focusable so keyboard users can scroll it.
Add PageShellFooter after the body for step actions, such as in a setup flow. It sits outside the scroll area, so it stays in view, and it always has a divider on top. PageShellFooterStart aligns left and PageShellFooterEnd aligns right; either can be left out, and the end group stays on the right without a start group.
The end group holds up to three buttons, with the main action last. Use the default variant for the main action and outline sm buttons for Skip and secondary actions. On narrow widths the groups wrap instead of overflowing. Buttons in the footer get a visible focus ring, including an unstyled Back button.
<PageShell>
<PageShellHeader>…</PageShellHeader>
<PageShellBody>…</PageShellBody>
<PageShellFooter>
<PageShellFooterStart>
<Button variant="unstyled">
<IconChevronLeft aria-hidden="true" />
Back
</Button>
</PageShellFooterStart>
<PageShellFooterEnd>
<Button size="sm" variant="outline">Skip</Button>
<Button size="sm">Continue</Button>
</PageShellFooterEnd>
</PageShellFooter>
</PageShell>The shell uses the standard surface and border tokens, so it follows the theme with no extra setup.
If the app already has a scroll container (for scroll restoration or infinite loading), render the body as that element with asChild. If the app tracks scrolling itself, pass scrolled to PageShell to control the divider.
<PageShell scrolled={isScrolled}>
<PageShellHeader>…</PageShellHeader>
<PageShellBody asChild>
<ScrollContainer>…</ScrollContainer>
</PageShellBody>
</PageShell>PageShell has no routing logic, so it works in Vite and Next.js apps. PageShellBack takes an onClick, an href, or asChild with a router link. BreadcrumbLink takes a render prop for router links.
<PageShellBack asChild>
<Link href="/finances" />
</PageShellBack>
<BreadcrumbLink render={<Link href="/finances" />}>Finances</BreadcrumbLink>Below the sm breakpoint, the shell is full-bleed with no radius or border, and the header is 56 px tall. The footer's bottom padding grows to clear the iOS home indicator. From sm up the header is 63 px, so the title lines up with the sidebar's logo row once the shell's 1 px border is added. Breadcrumbs show the full trail at every width: parent crumbs shrink and truncate first, and the current page only truncates once the parents can't shrink any further.
asChild?:
scrolled?:
className?:
href?:
onClick?:
asChild?:
label?:
asChild?:
children:
label?:
PageShellHeader, PageShellTitle, PageShellBreadcrumbs, PageShellActions, PageShellBody, PageShellFooter, PageShellFooterStart and PageShellFooterEnd also accept the props of the element they render.