Skip to content

Container

A max-width wrapper that centres content on the page with responsive side padding. Provides consistent content width across the application.

Preview

Narrow (640px) — prose, articles

max-width: 640px

Standard (960px) — forms, settings

max-width: 960px

Wide (1280px) — dashboards, tables

max-width: 1280px

Full-width — edge-to-edge content

width: 100%

Variants

VariantMax widthUse case
narrow640 pxProse, articles, auth forms
standard960 pxForms, settings pages
wide1280 pxDashboards, data tables
full100%Edge-to-edge layouts

Responsive padding

BreakpointSide padding
≥ 1024px32 px
≥ 768px24 px
< 768px16 px

Props

PropTypeDefaultDescription
size'narrow' | 'standard' | 'wide' | 'full''standard'Max width variant
asstring'div'HTML element to render
classNamestring--Additional CSS classes
childrenReact.ReactNode--Content

Code example

React

tsx
import { Container } from '@thepace/lexicon/components';

<Container size="narrow">
  <h1>Article Title</h1>
  <p>Prose content with optimal reading width.</p>
</Container>

<Container size="wide">
  <DataTable data={rows} />
</Container>

CSS utility

css
.my-container {
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-8);
  padding-right: var(--space-8);
}

CSS class reference

ClassPurpose
.lex-containerBase centred container
.lex-container--narrow640 px max width
.lex-container--standard960 px max width
.lex-container--wide1280 px max width
.lex-container--fullFull width

Guidelines

Do

  • Use the narrow container for long-form text content.
  • Use the wide container for data-heavy views.
  • Apply responsive padding that matches the spacing scale.

Don't

  • Don't nest containers — only the outermost page wrapper should be a container.
  • Don't hardcode pixel widths — use the container variants.

Released under the MIT License. A product by the pace.