Container
Container centers page content within a max-width and applies the canonical
horizontal gutter. It is the RSC-safe page-shell primitive: pair it with
Section for vertical rhythm, or pass space to fold the band into one node.
Import from "@desk/ui/components/container".
Usage
import { Container, ContainerProps } from "@desk/ui/components/container";Best practices
Containerconstrains width and applies the page gutter;Sectionis the full-bleed vertical-rhythm band — nest aContainerinside aSectionwhen content must be both padded and centered.Fold a single band into one node with
space(itspy) instead of nesting aSection; passfluidto drop the max-width.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| as | "div" | "li" | "nav" | "ol" | "span" | "ul" | "article" | "aside" | "figcaption" | "figure" | "footer" | "header" | "main" | "section" | Render as a different host element from the closed layout vocabulary
({@link LayoutElement}). The set is deliberately closed: | |
| asChild | boolean | Merge props onto the child element instead of rendering a | |
| fluid | boolean | Drop the max-width and let the container fill its parent. | |
| inset | "none" | "gutter" | ResponsiveValue<"base" | "2xs" | "xs" | "sm" | "lg" | "xl" | "2xl" | "3xl"> | Horizontal gutter. Defaults to | |
| responsiveMode | ResponsiveMode | Responsive mode: | |
| size | ResponsiveValue<ContainerSize> | Max-width token. Responsive; defaults to | |
| space | ResponsiveValue<SectionSpace> | Vertical rhythm (py). Responsive; omitted by default. |
Also exports
- interface
ContainerProps