Container
Container is a Box that registers itself as a CSS container. Descendants can then target it with
@<bp> keys in any responsive prop — reflow on the container's width, not on the viewport's.
What it is
A <Box> with container-type set. Most apps target one of two shapes — a name-less Container
so descendants address it implicitly with @<bp>, or a name="card" Container so descendants
target it explicitly with @card.<bp>. The two coexist; nested containers stay addressable.
Install
Container is exported from usemotif. No separate install.
API
Container
stablefunction Container(props: ContainerProps): JSX.Element
Container name. Descendants address this container with `@<name>.<bp>` keys (e.g. `p={{ "@card.md": "$4" }}`). When omitted, descendants can still target the nearest container with `@<bp>` keys.
CSS `container-type`. `"inline-size"` queries only the inline axis and is the most common choice. `"size"` queries both axes (more expensive). `"normal"` opts out of containment entirely.
Every prop Box accepts. `style` is merged — the resolved style adds `containerType` and (when supplied) `containerName`.
Examples
Implicit container — single-Container case where descendants target with @<bp>:
Named container — multiple containers nested, addressed by name:
Sidebar list of cards, each card its own container:
Cross-platform notes
On web Container emits the container-type / container-name CSS properties; container queries
resolve in any modern browser. On native CSS container queries are not part of the platform — the
component renders as a Box, and @<bp> descendant keys are dropped silently. The literal and
media-query ({ base, sm, md }) prop forms work everywhere; reach for container queries only when
you are sure the consuming surface is web.