Full Width Layout
Two Columns Layout (50/50)
Three Columns Layout (33/33/33)
Sidebar Layout (25/75)
Asymmetric Layout (67/33)
Four Columns Layout (25/25/25/25)
Mixed Pattern (1-2-1-2-1)
Complex Nested Layout
New in core v2.9.0 (rc09 / rc10 / rc12)
Flat sidebar section headings and dividers, plus navbar active state and responsive collapse.
Sidebar sections + divider
<SidebarSection> is a flat, non-interactive group heading; <SidebarDivider> draws a thin rule between groups. Both are <li> siblings to <SidebarItem> in the same list.
Code
Sidebar with flat sections
<Sidebar> <SidebarSection labelText="Project" /> <SidebarItem href="/" labelText="Dashboard" active /> <SidebarItem href="/components" labelText="Components" /> <SidebarDivider /> <SidebarSection labelText="Guides" /> <SidebarItem href="/getting-started" labelText="Getting Started" /> </Sidebar>
Zones: compose start / center / end
Navbar mirrors core's universal schema — a fixed burger plus three
open zones. It prescribes no fixed brand / nav / search / profile slots: compose
each zone from AppHeader, NavMenu, PageHeader, NavbarSearch, ProfileButton, … in any order you like.
<Navbar showBurger onburgerclick={toggle}>
{#snippet start()}
<AppHeader><h1>My App</h1></AppHeader>
<NavMenu>…</NavMenu>
{/snippet}
{#snippet center()}<PageHeader><h2>Dashboard</h2></PageHeader>{/snippet}
{#snippet end()}<ProfileButton name="Jane" onclick={openProfile} />{/snippet}
</Navbar> NavMenu: active state + responsive collapse
Mark the current section with isActive on a NavItem. Opt a NavMenu into progressive collapse with collapse — its
lowest-priority items fold out as the header narrows (per-item order via navPriority; navCollapse="hide" to just hide one). Touch
support for hover dropdowns is wired automatically.
<NavMenu collapse="menu" moreLabel="More">
<NavItem href="/" isActive navPriority={10}>Dashboard</NavItem>
<NavItem href="/reports">Reports</NavItem>
<NavItem href="/forms" navCollapse="hide">Forms</NavItem>
</NavMenu>
<!-- Or fold items into the sidebar instead of a "More" menu: -->
<NavMenu collapse="sidebar" collapseLabel="Menu">…</NavMenu> Navbar Fit: priority-driven header degradation (rc12–rc14)
Where navCollapse only folds nav items, Navbar Fit degrades every header slot — brand wordmark, version tag, page title, search box —
one at a time, lowest priority first, until the row fits, then
restores as space returns (no blanket mobile breakpoint). It's pure composition:
nothing fit-aware is baked into Navbar — wrap a slot in a FitSlot to opt it in. strategy="hide" drops the slot; strategy="steps" holds a ladder of FitStep variants
(widest first) that shrinks Svelte Pure Admin → SPA → gone. FitStep
auto-numbers the ladder and hides the non-first steps for a correct first paint —
no data-pc-fit-step or pc-fit-hidden to hand-author.
<Navbar>
{#snippet start()}
<AppHeader>
<h1>
<FitSlot strategy="steps" priority={30} class="pc-app-header__name">
<FitStep>Svelte Pure Admin</FitStep>
<FitStep>SPA</FitStep>
</FitSlot>
<FitSlot priority={10} class="pc-app-header__version">v1.9.0</FitSlot>
</h1>
</AppHeader>
{/snippet}
{#snippet center()}
<FitSlot priority={25} tag="div"><NavbarSearch onclick={openPalette} /></FitSlot>
<FitSlot priority={20} tag="div"><PageHeader><Heading level={2}>Dashboard</Heading></PageHeader></FitSlot>
{/snippet}
</Navbar>Card Layout Patterns
Various arrangements of cards using responsive grid layouts.
Full Width Card
Full Width Card
This card spans the entire width of the container.
Two Column Cards (50/50)
Left Card
Half width card on the left side.
Right Card
Half width card on the right side.
Three Column Cards (33/33/33)
Card 1
First of three equal cards.
Card 2
Second of three equal cards.
Card 3
Third of three equal cards.
Sidebar + Main Cards (25/75)
Sidebar Card
Narrow sidebar card for navigation or quick info.
Main Content Card
Wide main content card taking up most of the space.
Four Column Cards (25/25/25/25)
Card A
Quarter width card.
Card B
Quarter width card.
Card C
Quarter width card.
Card D
Quarter width card.
Asymmetric Cards (67/33)
Main Content Card
Larger card taking up 2/3 of the space for main content.
Side Panel Card
Smaller card for supplementary content.
Code Examples
Common Layout Patterns
<!-- Two Column (50/50) --> <Grid> <Column size="100" md="50">Left</Column> <Column size="100" md="50">Right</Column> </Grid> <!-- Three Column (33/33/33) --> <Grid> <Column size="100" md="1-3">Col 1</Column> <Column size="100" md="1-3">Col 2</Column> <Column size="100" md="1-3">Col 3</Column> </Grid> <!-- Sidebar Layout (25/75) --> <Grid> <Column size="100" md="25">Sidebar</Column> <Column size="100" md="75">Main</Column> </Grid>
Cards in Grid
<!-- Same height cards in grid -->
<Grid sameHeight>
<Column size="100" md="1-3">
<Card titleText="Card 1">
<p>Short content</p>
</Card>
</Column>
<Column size="100" md="1-3">
<Card titleText="Card 2">
<p>Longer content stretches,
and sibling cards match height.</p>
</Card>
</Column>
<Column size="100" md="1-3">
<Card titleText="Card 3">
<p>Also matches height</p>
</Card>
</Column>
</Grid>Nested Grids
<!-- Nested layout with sidebar -->
<Grid>
<Column size="100" md="2-3">
<!-- Nested grid inside main area -->
<Grid>
<Column size="100" md="50">Nested Left</Column>
<Column size="100" md="50">Nested Right</Column>
</Grid>
</Column>
<Column size="100" md="1-3">
<Card titleText="Sidebar">Content</Card>
</Column>
</Grid>