Skip to content

Layout

Container

Centred content column with page gutters. wide = layout.wide (page), narrow = layout.narrow (running text). The only way to limit width.

  • Ready
  • No keyboard interaction
  • No screen reader interaction

Updated 2026-11-12

Playground

Change the props. The controls come from the documented props.

Longer running text sits on the narrow width, so lines stay easy to read.

tsx
<Container>
  <p className="text-secondary">
    Longer running text sits on the narrow width, so lines stay easy to read.
  </p>
</Container>

Usage

When to use

Use a container to limit the width of page content and give it page gutters. It is the only way to set a content width in a screen.

When not to use

  • Inside another Container: the widths would fight.
  • When you need a full section with rhythm and a divider: use Section, which brings its own Container.

How it works

wide follows layout.wide for full pages, narrow follows layout.narrow for running text. The container is centred and keeps the side gutters on every screen size.

Content guidelines

Use narrow wherever people read more than a few sentences in a row; lines that run too long are hard to follow.

Do and don’t

  • Content

    DoOne Container: the content gets the page gutters once.

    Content

    Don’tNested Containers add the gutters twice.
Do
  • Put page content in a Container or Section.
  • narrow for longer text.
Don’t
  • No max-w-* utilities in screens; widths only through Container.
  • Don't nest Containers.

Anatomy

The parts of the component and what each one does, as in the playground above.
  1. containermax width from layout tokens, gutters 24px mobile, 32px from md.

Examples

Type-checked, and the same code goes into the AI manifest. Import: import { Container } from "@/ds";

narrow for running text

Longer running text sits on the narrow width, so lines stay easy to read.

Props

Checked against the component's TypeScript type on every build.
Container props
NameTypeDefaultDescription
size"wide" | "narrow""wide"layout.wide or layout.narrow.
as"div" | "main" | "header" | "footer" | "article""div"Semantic element.
children (required)ReactNode–Content.

Tokens used

Derived from the utility classes in the component's source. Copy a class with one click.
Tokens used by Container
TokenTierValueUtility
container.paddingX.desktopcomponent32px
container.paddingX.mobilecomponent24px
layout.narrowsemantic720px
layout.widesemantic1280px
text.secondarysemantic#555555

Accessibility

What is checked automatically on every build, and what a person has tested. Nothing is marked as tested unless it was.
Testing status by check
CheckHowStatus
axe-core rulesAutomated on every npm run check, at desktop and mobile widthRuns on every build
KeyboardAutomated Playwright test (scripts/keyboard.mjs)Not applicable
Screen readerManualNot applicable

Semantics and focus

  • as="main" for the main content when no Section carries it.