Container
Centers content and caps its width. Stock Mantine Container carrying the
design system's four width steps in place of Mantine's own six, plus a
responsive side gutter at the two largest steps that Mantine doesn't provide
on its own.
Usage
Innhold
<Container size="md">
{/* ... */}
</Container>
This preview frame is narrower than every step but xs (354px), so sm,
md and lg all render at the frame's full width here — drag the slider to
xs to see the actual difference; the table below is the source of truth for
what each step changes. xl is left out of the control on purpose; see the
note in Props. fluid ignores size entirely and stretches the container to
100% of its parent's width, exactly as it does in stock Mantine.
| Size | max-width | Side gutter |
|---|---|---|
xs | 354px | Constant spacing.md padding — Mantine's stock behaviour; no override exists for this step. |
sm | 768px | Same as xs. |
md | 1440px | No padding above the breakpoint; spacing.md padding reappears only below it. |
lg | 1920px | Same pattern as md. |
The md/lg breakpoints in container.module.css are written in px, not
rem(): rem() compiles to a calc() expression carrying --mantine-scale,
and a CSS custom property cannot appear inside an @media condition — it
would silently disable the rule. xs and sm have no dedicated rule in that
file, so they keep Mantine's always-on padding-inline rather than gaining
the breakpoint-gated gutter.
Props
Only what this design system changes. Everything else is Mantine's — read the full props table there.
| Property | Type | Allowed values | Default | Description |
|---|---|---|---|---|
size | MantineSize | number | xs · sm · md · lg · number | md | Caps the content width — 354, 768, 1440 or 1920px. A number still converts to rem, as in stock Mantine. Mantine's own xl step is not one of the four redefined here: passing size="xl" falls through to the generic numeric branch, which only converts numbers, so the keyword comes out unchanged and produces an invalid max-width. Stick to the four steps or a number. |
Accessibility
Container renders a plain <div> with no landmark role of its own. If it
wraps a page's main content, pass component="main" (Container forwards an
unrecognized component prop straight to the underlying Box) rather than
relying on the container to announce anything by default.