Shopware Design

Container

Usage

Container keeps page content at a readable width: it fills the available width up to its size and centers itself. It has no padding of its own, so the surrounding page stays in charge of spacing.

import { MtContainer } from "@shopware-ag/meteor-component-library";

Examples

Sizes

Three sizes are available: s (680px), m (960px, the default) and l (1280px). On narrower screens every size simply takes the full width.

Inside a page

Put the padding on the page and the container inside it. Use as to render a semantic element instead of a div.

API reference

Props

PropTypeDefault
size
The maximum width of the container: `s` (680px), `m` (960px) or `l` (1280px). The values come from the `--container-size-*` custom properties.
"s" | "m" | "l""m"
as
The element or component that renders the container.
string | Component"div"

Slots

SlotBindings
defaultany

Best practices

Do
  • Use s for forms and settings, m for regular pages and l for wide content such as tables or dashboards.
  • Keep padding and gaps on the page or a wrapper around the container.
  • Use one container per page and nest the page content inside it.
Don't
  • Do not add padding or borders to the container itself; wrap the content instead.
  • Do not nest containers to fine-tune widths.

Behavior

The widths come from three custom properties defined in the library's global stylesheet. Override them on :root to change the sizes for the whole application.

SizeCustom propertyDefault
s--container-size-s680px
m--container-size-m960px
l--container-size-l1280px
  • Card: when content inside the container needs a visible surface and a title.
  • Inset: when content should break out of its container's padding instead.