Layout Attributes

Use data-layout on semantic HTML elements for all VB layouts. No wrapper elements needed.

Stack Layout

Vertical rhythm with consistent spacing between child elements.

Cluster Layout

Horizontal grouping with wrapping. Perfect for tags, buttons, and navigation.

Cluster with justify-between

Header with Navigation
<header data-layout="cluster" data-layout-justify="between">
  <strong>Site Name</strong>
  <nav data-layout="cluster" data-layout-gap="m">
    <a href="#">About</a>
    ...
  </nav>
</header>

Grid Layout

Responsive auto-fit grid. Resize the browser to see columns adapt.

Center Layout

Max-width container with auto margins. Great for readable content.

Centered Content
<main data-layout="center" data-layout-max="narrow">
  <p>Centered content...</p>
</main>

Page Stack Layout

Header/Main/Footer with sticky footer. Main expands to fill available space.

Sticky Footer Pattern
<body data-layout="page-stack">
  <header>Header</header>
  <main>Main Content</main>
  <footer>Footer</footer>
</body>

Split Layout

Two-column ratio grid. Stacks on mobile.

2:1 Ratio Split
<section data-layout="split" data-layout-ratio="2:1" data-layout-gap="l">
  <article>Main content (2fr)</article>
  <aside>Sidebar (1fr)</aside>
</section>

Golden Ratio Split

Golden Ratio (1.618:1)
<section data-layout="split" data-layout-ratio="golden">
  <section>Primary (1.618fr)</section>
  <section>Secondary (1fr)</section>
</section>

Sidebar Layout

Two-column flexbox that wraps responsively. Try resizing the browser.

Holy Grail Layout

Classic 3-column layout with header/footer. Whole-page templates live on data-page-layout, not data-layout; it works on any element, so the mockups below use a <section>.

Full Holy Grail
<body data-page-layout="holy-grail">
  <header>Header</header>
  <nav>Nav</nav>
  <main>Main Content</main>
  <aside>Aside</aside>
  <footer>Footer</footer>
</body>

Holy Grail without Aside

The layout automatically adapts when semantic elements are missing.

Two-Column (no aside)
<body data-page-layout="holy-grail">
  <header>Header</header>
  <nav>Nav</nav>
  <main>Main Content</main>
  <!-- No aside - layout adapts automatically -->
  <footer>Footer</footer>
</body>

Dashboard Layout

App shell: header over a side nav and main. Below 48rem the nav becomes an off-canvas drawer that stays hidden (out of the tab order) until it is opened — as a native popover, or by toggling data-nav-open on the layout.

Dashboard App Shell
<body data-page-layout="dashboard">
  <header>
    Dashboard Header
    <button type="button" popovertarget="app-nav" data-nav-toggle>Menu</button>
  </header>
  <nav id="app-nav" popover aria-label="App">…</nav>
  <main>Dashboard Content</main>
</body>

<!-- Sticky header/nav: <html data-sticky> + data-layout-sticky on them -->

Cover Layout

Full-height container with vertically centered principal element. Use data-layout-principal on the centered child.

Hero Section
<section data-layout="cover" data-layout-centered>
  <header>Top content</header>
  <section data-layout-principal>
    <h1>Hero Headline</h1>
    <p>Vertically centered content</p>
  </section>
  <footer>Bottom content</footer>
</section>

Switcher Layout

Flexbox that switches from horizontal to vertical based on container width. No media queries needed.

Responsive Switcher
<section data-layout="switcher" data-layout-threshold="m">
  <section>Item 1</section>
  <section>Item 2</section>
  <section>Item 3</section>
</section>

<!-- Stacks when container < 30rem -->

Prose Layout

Utility for readable text content. Sets max-width in character units (ch).

Readable Text Width
<article data-layout="prose" data-layout-centered>
  <p>This text is constrained to a readable width...</p>
</article>

Composed Layouts

Real-world example: A blog card using nested layouts on semantic elements.

Blog Card
<article class="card" data-layout="stack" data-layout-gap="s">
  <header data-layout="cluster" data-layout-justify="between">
    <span class="tag">Tutorial</span>
    <time>Jan 18, 2026</time>
  </header>
  <h3>Building Semantic Layouts</h3>
  <p>Learn how to build...</p>
  <footer data-layout="cluster" data-layout-justify="between">
    <span>5 min read</span>
    <a href="#">Read more</a>
  </footer>
</article>

Summary

Layout Child Attrs? Use Case
stack No Vertical rhythm, forms, cards
cluster No Tags, buttons, nav links
grid No Card grids, galleries
center No Max-width containers
page-stack No Sticky footer pages
split No Two-column ratio layouts
sidebar No Responsive two-column
cover Yes Hero sections (data-layout-principal)
switcher No Container-query-like responsive
prose No Readable text width