Center

Center content horizontally with optional gutters, max width, and text alignment.

Examples

Properties

PropertyAttributeDescriptionType nameTypeDefault
maxmaxCSS max-width value for the centered containerstringstring"var(--measure)"
andTextand-textAlso center-align text inside the containerbooleanbooleanfalse
guttersguttersSide padding token (`none`, `xxs`, `xs`, `s`, `m`, `l`, `xl`, `xxl`; default `none`)DuoSpacing(typeof duoSpacingValues)[number]"none"
intrinsicintrinsicCenter children by their intrinsic widthbooleanbooleanfalse

Slots

NameDescription
defaultContent to center

Usage

Center constrains and centers block content—typical for article bodies, forms, or hero sections—using a configurable max width (default var(--measure)).

Do

  • Set max to the layout measure that fits your content column.
  • Use gutters for responsive side padding when the centered block touches viewport edges.
  • Enable and-text when headings and paragraphs inside should be text-centered.
  • Use intrinsic when children should center by their own width rather than filling the container.

Don’t

  • Don’t nest multiple Center wrappers without a clear layout reason—prefer one outer constraint per section.