Mushilu-San UI

Search components

PlaygroundStorybookGitHub
Layout

Container

Centres page content and limits its width to a readable measure.

Selector: mui-container

Import
import { Container } from '@mushilu-san/ui/layout';
PreviewCode

Loading example…

Overview

Container sets a maximum width from size and centres its content. padded adds side padding, which is on by default so content does not touch the screen edge on mobile.

Wrap the main content of a page in one container so line lengths stay comfortable on wide screens.

When to use

  • The main content column of a page.
  • Keeping a form or article at a readable width.

When not to use

  • Arranging items next to each other. Use a Stack or a Grid. Use Stack instead.

Guidelines

Do

  • Use one container for the main content of each page.

Don't

  • Do not nest containers. Each one adds padding and narrows the content.

Accessibility

Roles and attributes

ElementRoleNotes
host—A layout wrapper with no role. Use <main> around it for the main landmark.
  • Keep the content width readable. Long lines are harder to follow.

API

Container

Selector: mui-container

NameTypeDefaultDescription
size'sm' | 'md' | 'lg' | 'xl' | 'full''lg' Controls the max-width breakpoint of the container.
paddedbooleantrue Whether the container applies inline (horizontal) padding. Accepts attribute presence, e.g. <… padded>.

CSS parts

  • ::part(root)

Tokens

  • --mui-space-4
  • --mui-space-6