Layout

Container

Page-level wrapper that caps content width and applies consistent lateral padding from tokens. Polymorphic via the as prop.

Examples

Constrained content
Loading preview
<Container maxWidth="sm">Centered, width-capped content</Container>

API

PropTypeDefaultDescription
maxWidth'sm' | 'md' | 'lg' | 'xl' | 'full'lgMax content width; full removes the constraint.
padding'none' | 'sm' | 'md' | 'lg'mdLateral padding.
centeredbooleantrueCenter horizontally within the parent.

Styling and attributes

Like every component, Container accepts the universal token style props (m, p, sx, display, responsive maps, ...) and forwards standard DOM attributes (id, data-*, aria-*, event handlers) to the underlying element. See Styling for the full API.

Guidelines

Do

  • Use one Container per page region to keep line lengths readable.

Avoid

  • Do not nest Containers; use Stack or Grid inside instead.

Import from @hub/ds-components. Interactive playground: Storybook. Figma Code Connect node 299-130.