Layout and composition

Use layout blocks to control width, spacing, and placement. Put the visible copy and media in the child blocks so editors can update them in Webadmin.

Choose a layout block

Need Block Use it for
A major page band section Group related content, with optional section spacing or background media.
A limit on content width container Keep an article or group of blocks within a comfortable width.
Vertical spacing stack Arrange a heading, copy, and supporting blocks from top to bottom.
A main area with a compact second side split Pair text with media or content with an action. Use exactly two direct children in a nested API plan.
A horizontal group that can wrap cluster Keep related actions or compact items together.
A responsive set of columns grid Place feature cards or paired content in two, three, or four columns.
An independent framed item card Compose an item with card_header, card_body, and card_footer as needed.

Compose a section

Start with a Section for the band and a Container to control its width. Inside the Container, use a Stack for narrative content or a Grid for repeated items. Use a Cluster inside a Stack when two actions should sit together. If a Split side needs several blocks, put them inside a Stack so the Split still has two direct children.

Section
└── Container
    └── Stack
        ├── Header
        ├── Rich Text
        └── Cluster
            ├── Button Link
            └── Button Link

Review on a narrow screen

Preview the section at desktop and phone widths. Use a stacking Split when two sides need to read as a column on a narrow screen. In a Split with one media side, choose the mobile order based on what visitors should read first. For a grid of linked cards, check the order after stacking and keep each linked card free of nested links and buttons.

See Block Type Contracts for exact settings and placement rules, and Public Block Render Markup for the rendered structure. Browse the full layout block reference or composition recipes. Back to Inventory.

Layout And Composition Blocks

section — Section

Contract area Source-backed behavior
Purpose Major semantic page band and child grouping.
Admin-editable content No visible copy. Optional settings.layout_name is editor metadata only.
Settings spacing: empty, sm, lg; flow: normal, offset-up, overlap-previous; optional background media_id; background_position: center, top, bottom, left, right; background_overlay: soft, medium, strong, none.
Children Any supported published child type; at least one renderable child is required by API plans.
HTML Root-owning <section class="wb-section [wb-section-sm or wb-section-lg] [wb-public-section--offset-up or wb-public-section--overlap-previous] wb-stack" data-wb-public-block-type="section">…</section>. Background media adds package-owned class/style hooks. Flow modifiers reset on small screens.
Example appearance A full-width themed band containing a constrained Container, or one deliberately shifted band that breaks uniform vertical rhythm.
Avoid Visible text in settings, empty chrome, using Section as a card, or overlapping several consecutive sections.

container — Container

Contract area Source-backed behavior
Purpose Width constraint and optional child flow.
Admin-editable content No visible copy; optional editor-only layout_name.
Settings width: empty, sm, md, lg, xl, full; flow: stack or none.
Children Any supported published child type; at least one child required by API plans.
HTML Root-owning <div class="wb-container [wb-container-*] [optional wb-stack]" data-wb-public-block-type="container">…</div>; wb-stack requires explicit flow: stack.
Example appearance Centered page content with a maximum width; the neutral default composes directly with a Cluster inside Navbar.
Avoid Treating width as a surface, card, or theme role.

stack — Stack

Contract area Source-backed behavior
Purpose Vertical flow and consistent rhythm between direct child blocks.
Admin-editable content No visible copy; optional editor-only layout_name.
Settings spacing: empty/default, 1, 2, 3, 4, 6, 8.
Children Any supported published child type; at least one child required by API plans.
HTML Root-owning <div class="wb-stack [wb-stack-{n}]" data-wb-public-block-type="stack">…</div>.
Example appearance A product name, description, and supporting note arranged from top to bottom.
Avoid Page-width control, horizontal actions, or equal columns.

split — Split

Contract area Source-backed behavior
Purpose Two-sided composition where the first child grows and the second stays content-sized.
Admin-editable content No visible copy; optional editor-only layout_name.
Settings gap: empty/default, 0, 1, 2, 3, 4, 6, 8; items_alignment: center/default, start, end, stretch; width: auto/default or full; responsive: stack or preserve. New admin/API blocks default to stack while existing empty settings preserve the legacy row.
Children The panel, Content API, and MCP use the same two-child limit for direct placement. Authors can add the two children separately and the panel can retype an existing child in place. A move out of a full Split in the panel or MCP exchanges positions with a block from the destination sibling group in the same slot. Staged API promotion validates that a retained full Split still has two direct children. Nested API payloads for a new Split require exactly two direct children. Put a Stack inside either side when that side needs multiple blocks.
HTML Root-owning <div class="wb-split …" data-wb-public-block-type="split">…</div> with allowlisted wb-* classes. Responsive stack adds package-owned .wb-public-split--stack-mobile and changes to a full-width column at 48rem and below.
Example appearance Product identity on the left and a price plus buy action on the right.
Avoid Repeated equal columns, wrapping button groups, or more than two direct children.

cluster — Cluster

Contract area Source-backed behavior
Purpose Horizontal or inline composition, especially actions and navbar internals.
Admin-editable content No visible copy; optional editor-only layout_name.
Settings gap: empty, none, xs, sm, md, lg; alignment: start/default, center, end, between; items_alignment: center/default, start, end, stretch; wrap: wrap/default or nowrap; width: auto/default or full.
Children Any supported published child type; at least one child required by API plans.
HTML Root-owning <div class="wb-cluster …" data-wb-public-block-type="cluster">…</div> with allowlisted wb-* classes.
Example appearance A responsive two-button CTA row or brand/navigation/actions row.
Avoid Large repeated card grids.

grid — Grid

Contract area Source-backed behavior
Purpose Responsive multi-column layout.
Admin-editable content No visible copy; optional editor-only layout_name.
Settings columns: 2, 3, 4; ratio: equal, lead-left, lead-right (asymmetric ratios apply only to two columns); gap: empty, 3, 4, 6; alternate_media_text_sections: boolean; alternate_start: media_left or text_left.
Children Any supported published child type; at least one child required by API plans.
HTML Root-owning <div class="wb-grid wb-grid-{n} [wb-gap-{n}] [wb-public-grid--lead-*]" data-wb-public-block-type="grid">…</div>. Lead ratios render as 2:1 or 1:2 above the normal one-column mobile breakpoint. Alternating mode may change direct-child order without changing the root.
Example appearance Three Card blocks in a feature row, or paired Image/content groups alternating left and right.
Avoid Semantic tables or a compact action row.

card — Card

Contract area Source-backed behavior
Purpose Composable framed surface.
Admin-editable content No normal visible parent copy; optional editor-only layout_name. Legacy no-region Card rows may still render old copy.
Settings Optional Card style on the shared variant column: flat, muted, highlight, accent; an empty variant renders the default card. Optional background image media_id, background_position, background_overlay. Optional url and target make the entire composable Card one semantic link.
Children Direct children restricted to card_header, card_body, card_footer; at least one child required by API plans.
HTML Root-owning <article class="wb-card">…</article>, or <a class="wb-card wb-no-decoration">…</a> when a whole-card URL is configured. Linked Cards must not contain nested interactive controls.
Example appearance Image or icon header, editable body content, and action footer inside one native Card shell.
Avoid Cards nested inside Cards or using legacy parent copy for new content.

card_header — Card Header

Contract area Source-backed behavior
Purpose Header region inside Card.
Admin-editable content No direct copy; child blocks hold content. Optional editor-only layout_name.
Settings icon_slug from the active content icon catalog; icon_tone: default, soft, brand, accent, highlight, bold, quiet; icon_size: default, sm, lg, xl.
Children Structured content children. Do not nest Card region blocks. Normal placement is directly under Card.
HTML Root-owning <div class="wb-card-header" data-wb-public-block-type="card-header">[icon]…</div>.
Example appearance Card title row with a catalog icon and nested Header/Plain Text.
Avoid Placement outside Card.

card_body — Card Body

Contract area Source-backed behavior
Purpose Main content region inside Card.
Admin-editable content No direct copy; child blocks hold content. Optional editor-only layout_name.
Settings No public visual setting beyond editor-only layout_name.
Children Structured content children; API plans require at least one. Do not nest Card region blocks.
HTML Root-owning <div class="wb-card-body" data-wb-public-block-type="card-body">…</div>.
Example appearance Card copy, Image, Rich Text, or a small Cluster of buttons.
Avoid Placement outside Card.
Contract area Source-backed behavior
Purpose Supporting or action region inside Card.
Admin-editable content No direct copy; child blocks hold content. Optional editor-only layout_name.
Settings No public visual setting beyond editor-only layout_name.
Children Structured content children; API plans require at least one. Do not nest Card region blocks.
HTML Root-owning <div class="wb-card-footer" data-wb-public-block-type="card-footer">…</div>.
Example appearance One or two Button Link children aligned by a nested Cluster.
Avoid Placement outside Card.

slider — Slider

Contract area Source-backed behavior
Purpose Composable carousel that fills its placed container.
Admin-editable content No visible parent copy; optional editor-only layout_name.
Settings height: auto, fill, viewport, large, medium, small, custom; optional min_height; aspect_ratio: 16/9, 4/3, 1/1; interval_ms: 1000–30000; booleans autoplay, pause_on_hover, show_arrows, show_dots, loop, swipe, keyboard; overlay: none/default, soft, medium, dark, strong; content_position: center/default, center-left, center-right, top-left, top-center, top-right, bottom-left, bottom-center, bottom-right; content_width: medium/default, narrow, wide, full; text_color: auto/default, light, dark; background_fit: cover/default or contain. Transition is currently normalized to slide.
Children Only slide; at least one Slide required.
HTML Root-owning <section class="wb-slider …" data-wb-slider data-wb-public-block-type="slider"> with viewport, track, optional arrows, and dots. The first slide receives fetchpriority="high" only when its Slider is the leading content branch after header/sidebar slots; nested Section, Container and Stack leading branches are eligible. Other slides use low. Sources remain eager and directly addressable; interaction, focus and autoplay remain WebBlocks UI-owned.
Example appearance Full-width hero carousel, card-contained slider, or background-media panels with editable child content.
Avoid Static image galleries.

slide — Slide

Contract area Source-backed behavior
Purpose One panel inside Slider.
Admin-editable content No direct visible copy; optional editor-only layout_name and shared aria_label.
Settings Background image media_id; background_position; background_overlay (none, soft, medium, strong — each renders a distinct scrim since WebBlocks UI 2.22.0; before that medium collapsed onto strong); content_position: center/default, center-left, center-right, top-left, top-center, top-right, bottom-left, bottom-center, bottom-right; content_width; text_color; background_fit.
Children Any supported structured child type; a background-only Slide is allowed. Normal parent is Slider.
HTML Root-owning <article class="wb-slide …" data-wb-public-block-type="slide">[optional picture > img.wb-slide-media]<div class="wb-slide-content">…</div></article>. Public raster media uses aspect-preserving 640/1280/1920-width candidates, measured widths, sizes="100vw", intrinsic dimensions and asynchronous decoding. Optional WebP sources require successful GD conversion and precede original-format fallbacks. Mobile sources up to 768px precede desktop sources. Missing/private mobile media, unsupported codecs and failed transforms retain the existing fallback. Position, fit and overlay remain shared.
Example appearance Background product photo with nested Header, Plain Text, and Button Link content.
Avoid Standalone top-level use when no carousel semantics are intended.

Visual Composition Recipes

These are managed block trees, not fixed templates. Confirm all handles at runtime.

Start from the least framed recipe that satisfies the content. Do not repeat the same recipe in adjacent page bands, and do not select the feature-card recipe merely because the source contains three short items.

Editorial introduction with foreground media

section(spacing:lg)
└── container(width:xl)
    └── hero(layout:split, foreground media)
        ├── button_link(primary)
        └── button_link(secondary)

Use a large, meaningful image and restrained surface styling. Choose layout:full-bleed when the image should become a viewport-wide, unframed opening band; retain split when the image is semantic foreground content.

Unframed principles or benefits

section(spacing:lg)
└── container(width:xl)
    └── columns(variant:plain)
        ├── column_item
        ├── column_item
        └── column_item

This is the normal starting point for qualities such as experience, communication, care, speed, or reliability. Promote it to Cards only when the items are independently actionable or bounded.

Marketing page intro with separate actions

section(background optional)
└── container(width:lg)
    ├── hero(variant:accent, layout:centered)
    └── cluster(alignment:center, gap:sm)
        ├── button_link(primary)
        └── button_link(secondary)

Use this only when the action row should sit outside the Hero promo root. Hero itself accepts Button Link children in every layout, including split; keep actions inside Hero when that is the intended composition.

Bounded entity card grid

section(spacing:lg)
└── container(width:lg)
    ├── header(h2)
    └── grid(columns:3, gap:4)
        ├── card
        │   └── card_body
        │       ├── header(h3)
        │       ├── plain_text
        │       └── button_link
        ├── card
        └── card

Every title, paragraph, and action remains independently editable. Reserve this recipe for bounded entities such as products, plugins, plans, downloads, or services with their own actions. Use site CSS for a consistent site-specific Card skin through stable hooks; do not inject card HTML.

Alternating image and copy rows

section
└── container
    ├── grid(columns:2, alternate_media_text_sections:true, alternate_start:media_left)
    │   ├── image
    │   └── card or content stack
    └── grid(columns:2, alternate_media_text_sections:true)
        ├── image
        └── card or content stack

Use Image for foreground media. Use a background-capable block only when the image is semantically a background.

Shared responsive navbar

sticky-navbar(sticky)
└── container(width:lg)
    └── cluster(alignment:between, width:full)
        ├── navbar-brand
        └── cluster
            ├── navbar-navigation
            └── header-actions

Navigation labels and URLs belong to CMS Navigation records, not to HTML.

Managed image slider

slider(height:viewport, autoplay:false, show_arrows:true, show_dots:true)
├── slide(background media)
│   └── container
│       ├── header
│       ├── plain_text
│       └── button_link
└── slide(background media)
    └── container
        └── card
            └── card_body
                └── rich-text

CSS Guidance

Use styling layers in this order:

  1. WebBlocks UI primitives already emitted by the renderer.
  2. Public Theme tokens and mode-aware public color roles.
  3. Native block settings and variants.
  4. Narrow site-specific CSS using stable hooks.
  5. A reusable renderer or block contract change when the required DOM is missing.

Stable selectors include:

body[data-wb-public-theme] {}
[data-wb-public-block-type="hero"] {}
[data-wb-public-block-type="card"] {}
.wb-promo {}
.wb-card {}
.wb-content-header {}

Do not use site CSS to:

  • insert essential text with pseudo-elements;
  • depend on generated block IDs;
  • infer semantics from sibling order;
  • hide CMS-authored content merely to replace it with CSS content;
  • rebuild a missing layout with fragile absolute positioning;
  • hardcode light-only colors that break Light/Dark/Auto mode.