layouts
Center
Horizontal centering by max-width + margin auto. Supports gutters and intrinsic centering.
Centered
API Reference
CenterProps
Extends native HTML attributes inferred from the rendered element `as`.
| Property | Type | Default | Description |
|---|---|---|---|
as | ElementTag | "div" | HTML element to render as. |
ref $bindable | HTMLElement | Reference to the rendered DOM element. | |
maxWidth | string | "65ch" | Maximum width of the centered content. |
gutters | union | Horizontal padding on both sides. Accepts a space scale token or an arbitrary CSS value. | |
intrinsic | boolean | false | Centers content intrinsically using `fit-content` instead of a hard max-width. |
children | Snippet | Content to render inside the center container. |