Container
The width contract from LAYOUT_PHILOSOPHY.md §2: four sizes only, each mapped to one layout token, plus the responsive horizontal padding scale `px-4 xs:px-6 lg:px-8` (§5).
Preview
Rendered from the story the storybook (a11y) CI gate runs axe against — the preview can't show something that hasn't been verified.
Install
Two equivalent paths — the URL works in any shadcn-CLI setup; the alias works once you've registered @interlace in your components.json.
npx shadcn@latest add https://ds.interlace.tools/r/container.jsonnpx shadcn@latest add @interlace/containerHistory
This component is at v3.0.1, first shipped in @interlace/ui 1.0.0. The version is stamped as a banner into the file the install writes, so the copy in your tree says which one you have — compare it with the number above before deciding whether to re-run the install.
@interlace/ui 2.0.02 entries
- Breakingmajor
Interlace no longer rewrites the host app's Tailwind theme. Installing one component used to redefine
max-w-sm(24rem became 1rem), movesm:from 640px to 480px, delete2xl:and change everyrounded-sm|md|lg. Spacing is now Tailwind's numeric scale, which follows--spacing. Radius derives from--radiusexactly as shadcn derives it. The only breakpoint Interlace declares is a newxs:tier at 480px, which Tailwind doesn't use. Components render pixel-for-pixel as before.Components- @interlace/accordion
- @interlace/alert
- @interlace/alert-dialog
- @interlace/article-card
- @interlace/article-list-grid
- @interlace/article-template
- @interlace/auth-template
- @interlace/author-byline
- @interlace/author-template
- @interlace/blog-home-template
- @interlace/box
- @interlace/breadcrumb
- @interlace/button
- @interlace/button-variants
- @interlace/callout
- @interlace/checkbox
- @interlace/code-block
- @interlace/code-editor
- @interlace/code-window
- @interlace/combobox
- @interlace/command-palette
- @interlace/context-menu
- @interlace/cta-section
- @interlace/dashboard-template
- @interlace/data-table
- @interlace/dialog
- @interlace/distribution
- @interlace/docs-page-template
- @interlace/dropdown-menu
- @interlace/empty-state
- @interlace/error-template
- @interlace/faq
- @interlace/feature-grid
- @interlace/figure
- @interlace/focus-cards
- @interlace/focus-ring
- @interlace/footer
- @interlace/grade-badge
- @interlace/grid
- @interlace/hero
- @interlace/hero-cosmic
- @interlace/hover-card
- @interlace/input
- @interlace/landing-template
- @interlace/lint-playground
- @interlace/metric-table
- @interlace/network-graph
- @interlace/newsletter-form
- @interlace/number-field
- @interlace/page-header
- @interlace/pagination
- @interlace/popover
- @interlace/prev-next-post
- @interlace/pricing-table
- @interlace/prose
- @interlace/radial-weave
- @interlace/registry-item-template
- @interlace/related-posts
- @interlace/scorecard-row
- @interlace/scorecard-template
- @interlace/section-boundary
- @interlace/select
- @interlace/settings-template
- @interlace/sheet
- @interlace/shimmer-button
- @interlace/skeleton
- @interlace/skeleton-variants
- @interlace/skip-link
- @interlace/stack
- @interlace/stat-card
- @interlace/stat-group
- @interlace/stat-strip
- @interlace/stats-template
- @interlace/sunny-background
- @interlace/tabs
- @interlace/tag-template
- @interlace/testimonial
- @interlace/textarea
- @interlace/theme
- @interlace/theme-switcher
- @interlace/theme-tokens
- @interlace/time-series
- @interlace/timeline-map
- @interlace/toast
- @interlace/toc
- @interlace/toggle
- @interlace/tooltip
- @interlace/topbar
- Addedminor
Layout fixes found on a real wide-screen page: - Timeline: in a wide column each event gets at least 13rem. More events than fit wrap onto a second row with its own rule, instead of squeezing into thin strips. - Container:
prose,contentandwideread--container-prose,--container-contentand--container-wide, the same tokens as Topbar and Footer, so retuning a token moves every edge together. - Topbar: row links never wrap onto two lines, and a newcollapseBelowprop (md,lg,xl; defaultmd) sets the width below which the links move into the menu.Components
Import
2 named exports — pull the parts you need.
import { Container, containerVariants } from '@/components/ui/container';Anatomy
Extracted from the primitive's JSDoc header. The source is the only documentation that can't drift.
Container (div by default, or the `render` element)
└─ children (data-size carries the chosen size)Variants
Closed prop unions enforced by class-variance-authority. See Storybook's Variants story for the rendered matrix.
- size
- prose
- contentdefault
- wide
- full
API reference
Parsed from the type declarations in the source — the same file the install writes into your tree, so this table can't drift from the component you get.
ContainerProps
Plus the variant props listed above.
| Prop | Type | Description |
|---|---|---|
| render | useRender.RenderProp | — |
Accessibility
Every story for this component is rendered headlessly and checked with axe-core (wcag2aa, wcag22aa, best-practice, ACT) on every PR. That gate has no continue-on-error, so what ships has zero known violations.
What follows is what static analysis can see. Axe cannot press a key and never sees an overlay open, so the operable-without-a-mouse claim lives in Behavior instead, where the keyboard path is replayed step by step.
- Focus + keyboard behaviour
- Owned by @base-ui/react/use-render — focus trapping, dismissal and typeahead come from the headless primitive, not from us.
- Focus ring (WCAG 2.2 SC 2.4.13)
- Not focusable — no focus indicator required.
- Reduced motion
- No animation to gate.
- ARIA in the source
- None — semantics come from the element or the Base UI primitive rather than hand-written ARIA.
Examples
4 more states from the same story file.
R-rule compliance
Every primitive in @interlace/ui models to the portable 26-rule floor enforced by the componentApi ESLint preset. The cells below pin exactly where each rule applies in this file.
| Rule | Concept | Where |
|---|---|---|
| R4 | Extends native el | `React.ComponentProps<'div'> & VariantProps<…>` |
| R6 | data-slot + data-size on root | `'data-slot': 'container'`, `'data-size': size` |
| R7 | cva + cn + ...rest | `cn(containerVariants({ size }), className)` + `...props` |
| R8 | Enum for size | prose / content / wide / full |
| R10 | Composition seam | `render` — Base UI's `useRender`, not an `as` prop |
| R18 | Tailwind only | widths are utilities; zero inline `style` |
Dependencies
- Base UI primitive
- @base-ui/react/use-render
- Lucide icons
- none
- NPM dependencies
@base-ui/reactclass-variance-authority
- Registry dependencies
Source
The full implementation — components/ui/container.tsx once installed.
import * as React from "react";
// @interlace/container v3.0.1 — Interlace design system.
// Docs, props and live preview: https://ds.interlace.tools/c/container
// What changed since: https://ds.interlace.tools/c/container#history
// Generated banner — keep it, the upgrade diff reads this version.
/**
* @interlace/ui — Container
*
* The width contract from LAYOUT_PHILOSOPHY.md §2: four sizes only, each
* mapped to one layout token, plus the responsive horizontal padding scale
* `px-4 xs:px-6 lg:px-8` (§5).
*
* It is what every page section is measured by — the ad-hoc widths that would
* otherwise accumulate in app code are the thing it exists to retire.
*
* ## The four sizes
*
* | size | max-width | Use |
…87 more lines…Registry JSON
The raw registry record — what the shadcn CLI fetches.