Skip to main content
Copy for LLM

Container

A width-constrained wrapper that centers content horizontally. Use it to control the maximum width and inline padding of page sections.

Basic Usage

Default container (xl)
The default container, xl, stops at 80rem and centers itself. This preview is narrower than 80rem, so the card takes all of it.

Max Width Sizes

The max prop sets the width of the content: the padding stands outside it, so the container itself may grow to the size plus its padding on both sides. A navbar, a hero, a brand bar and a footer with the same max do the same, so on a wide screen they all start their content at one line. All sizes use design tokens with sensible fallbacks. A size wider than the preview, lg and up, fills it as full does; the difference shows on a wider screen.

Small container
max="sm" — 40rem
Medium container
max="md" — 48rem
Large container
max="lg" — 64rem
Full width container
max="full" — no width limit

Padding

Control the horizontal padding with the padding prop. Useful for ensuring content doesn't touch screen edges on smaller viewports. padding="lg" is the padding the navbar, the hero and the brand bar use, so with it the container's content stands on their line at every width; the default md stands a little further out on a screen narrower than the container.

No padding
No horizontal padding
Large padding
padding="lg" — 1rem horizontal padding

Without Centering

By default the container is centered via mx-auto. Set :center="false" to disable this.

Container at the start of the line
This container is not centered — it stays at the start of the line.

Semantic Elements

Use the as prop to render a semantic HTML element instead of a div.

Container as section
Rendered as a section element for semantic HTML.

Props

Prop Type Default Description
max string 'xl' Max width: sm, md, lg, xl, 2xl, full
padding string 'md' Horizontal padding: none, sm, md, lg, xl
center bool true Center the container horizontally with mx-auto
as string 'div' HTML element to render
scope string|null null Scoped personalization name

Keyboard Interaction

This component is a layout wrapper. Keyboard interaction is delegated to its children.

Design Tokens

The container sizes use dedicated tokens with CSS fallbacks:

Token Default Description
--size-wk-container-sm 40rem Small container max width
--size-wk-container-md 48rem Medium container max width
--size-wk-container-lg 64rem Large container max width
--size-wk-container-xl 80rem XL container max width
--size-wk-container-2xl 96rem 2XL container max width

Padding tokens:

Token Default Description
--padding-wk-x-sm 0.625rem Small horizontal padding
--padding-wk-x-md 0.75rem Medium horizontal padding, the default
--padding-wk-x-lg 1rem Large horizontal padding
--padding-wk-x-xl 1.5rem XL horizontal padding

Updated in WireKit v2.74.0 (2026-11-24)

Was this page helpful?

Thank you for your feedback!

Voting requires cookies or local storage. What we store