Layout
PageShell
The standard page container with a title, a description and an actions slot.
<script>
import { PageShell, Button } from "@codeatlasdev/ui";
</script>
<PageShell title="Dashboard" description="Overview of this month">
{#snippet actions()}<Button size="sm">New report</Button>{/snippet}
<!-- page content -->
</PageShell>
PageShell never renders <main>. Inside AppShellLayout the shell is the <main id="main"> landmark; on a page with no shell (a one-screen app) wrap it yourself, with a skip link first, or axe reports landmark-one-main:
<script>
import { PageShell, SkipLink } from "@codeatlasdev/ui";
</script>
<SkipLink />
<main id="main" tabindex="-1">
<PageShell title="Pipeline">…</PageShell>
</main>
A one-page app does not need AppShellLayout for this. See the Standalone page recipe.
Below 900px the header stacks: the description leads and actions wrap onto their own row. Buttons share that row full-width (large tap targets); everything else (IconButton, ThemeToggle, StatusChip, Chip, Badge, plain text) keeps its natural size and stays at the end of the row.
The shell renders title as the page <h1>; below 900px inside an AppShellLayout it is hidden visually because the mobile header already shows it. Inside a PageShell, AppSettings or AppForm, EmptyState and FormSection titles default to <h2> (under the page <h1>). Pass headingLevel to EmptyState, FormSection or Card to pick the level explicitly.
Dashboard page
KPI cards and a content card inside a PageShell.
- Revenue
- $118k
- ↑+23.4%
- Users
- 24.8k
- ↑+8.1%
- Growth
- 34%
- ↑+5.6%
- Uptime
- 99.9%
- ↑+0.1%
Chart or data table goes here
Reference #187 · Pick in the gallery
Code
Aside and reading width
Pass an aside snippet for a companion column (in-page index, summary, help, preview). When the shell itself is at least 60rem wide the aside sits next to the content (about 17rem, sticky); below that it follows the content. The breakpoint is the shell’s width, not the viewport’s, so an open AppShellLayout panel is accounted for. It renders as <aside>; name it with asideLabel when a page has more than one complementary landmark.
width="reading" caps the content column at 46rem so forms and settings keep a readable line length instead of stretching to maxWidth. With an aside the pair is centred. width="wide" (default) is the previous behaviour.
Reading width with an aside
width="reading" plus an aside snippet holding a section index.
General
Reference #600 · Pick in the gallery
Code
Props
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | – | Page title. |
description | string | – | Supporting text under the title. |
gap | number | undefined | Vertical gap between the header and the content, in px. Omit for `--ca-space-7` (28px at the default density). |
maxWidth | string | undefined | Maximum width of the content column, any CSS length. Omit for 80rem (1280px at the default 4px spacing unit). |
width | 'reading' | 'wide' | 'wide' | `reading` caps the content column at 46rem (forms, settings). `wide` fills the shell up to `maxWidth`. |
actions | Snippet | – | Right side of the page header. |
aside | Snippet | – | Companion column rendered as `<aside>`: beside the content (sticky, ~17rem) when the shell is at least 60rem wide, after the content below that. |
asideLabel | string | 'Page sidebar' | Accessible name of the `<aside>` landmark (localized default). |
children | Snippet | – | Page content. |
class | string | '' | Extra class names. |