Skip to main content
WireKit
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)
This content is constrained to the default max width (xl = 80rem) and centered.

Max Width Sizes

The max prop controls the maximum width of the container. All sizes use design tokens with sensible fallbacks.

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.

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

Without Centering

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

Left-aligned container
This container is not centered — it stays left-aligned.

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
--space-wk-sm 0.5rem Small horizontal padding
--space-wk-md 1rem Medium horizontal padding
--space-wk-lg 1.5rem Large horizontal padding
--space-wk-xl 2.5rem XL horizontal padding

Was this page helpful?

Voting requires cookies or local storage. What we store