Skip to main content

Containers

Structural layout components used to group and space related content. Use to establish visual hierarchy and contain distinct page regions. Don't use as a substitute for spacing tokens.

Figma Storybook Docs

Description

What it does

Containers wrap related content in a visually bounded region, applying consistent internal padding, background colour, border, and radius to define a distinct section of a page or panel.

Where it appears

Throughout Open Point and Social Point — dashboard cards, stakeholder profile sections, consultation step panels, form groupings, sidebar regions, and modal body areas.

Why it exists

Government interfaces carry dense, multi-domain content. Containers create clear visual boundaries between information regions, reducing cognitive load and helping users identify where one task or topic ends and another begins.

Dependencies

Cards, Dividers, Panels

Anatomy

PartRequired?Notes
Container root Required The outer element (div or semantic equivalent). Sets the background, border, radius, and padding via tokens.
Container header Optional A heading or labelled region at the top of the container. Anchors the section for screen readers. Use an appropriate heading level (h2-h4) based on page hierarchy.
Container body Required The main content region inside the container. Receives vertical rhythm via --op-space-* tokens applied to child elements.
Container footer Optional A bottom row for actions (e.g. Save, Cancel) or meta information (e.g. last updated timestamp). Visually separated from the body using a border or spacing.
Border Optional A 1px stroke using --op-color-border-default. Omit on containers placed on --op-color-bg-secondary surfaces where background contrast already defines the boundary.
Elevation / shadow Optional Used selectively on floating containers (drawers, popovers). Not applied to inline page containers.

Variants

Default

Neutral grouped content region on a primary background.

General grouping of related fields, summaries, or descriptive content within a page section. The most common container type.

Outlined

Container with explicit 1px border, no elevated background.

When the container sits on --op-color-bg-primary and background contrast alone is insufficient to define the boundary. Common in form sections and stakeholder record panels.

Filled (Subtle)

Container with --op-color-bg-secondary background and no border.

De-emphasised groupings such as supplementary information, help text blocks, or read-only data summaries nested within a primary container.

Filled (Accent)

Container with a status or brand-tinted background for callouts.

Contextual highlights — e.g. an active consultation notice, a compliance warning, or an onboarding prompt. Pair with the matching status token (info, warning, success, error).

Flush

Container without padding, radius, or border.

When the container is used purely for structural grouping within a layout grid and visual boundaries are handled by the parent. Do not use where content needs visual separation.

States

State Behaviour
Default Static, fully visible. No interaction affordance. Content is readable and actionable.
Loading Container body is replaced by a skeleton loader or wa-spinner. Header and footer remain visible to preserve layout stability. Applied when content is fetched asynchronously (e.g. stakeholder engagement history).
Empty Container body displays an empty-state message with optional CTA. Minimum height is maintained so the page layout does not collapse. Example: 'No submissions yet — share the consultation link to get started.'
Error Container body displays an inline error message using --op-color-status-error and --op-color-status-error-bg. The header and footer remain, allowing retry or navigation actions.
Disabled Entire container and its contents are non-interactive. Opacity reduced to 0.5. Applied when a section is locked pending a prerequisite step (e.g. review stage not yet reached).

Usage guidelines

When to use

  • Grouping a set of related fields within a multi-section form (e.g. 'Contact details', 'Engagement preferences').
  • Isolating a summary or read-only record on a stakeholder profile page.
  • Wrapping a consultation step or phase panel so users can distinguish it from other steps.
  • Creating a card-like region on a dashboard for metrics, activity feeds, or quick actions.
  • Containing an aside or supplementary information block (filled-subtle variant) next to primary content.

When not to use

  • Do not use a container as a substitute for spacing tokens. Use --op-space-* margins and gaps between elements instead of wrapping them in an extra container.
  • Do not nest containers more than two levels deep. Excessive nesting creates visual noise and makes hierarchy ambiguous. Flatten the structure or use dividers instead.
  • Do not use the accent-filled container for purely decorative purposes. Reserve status backgrounds for genuine status communication.
  • Do not use a container for a single standalone element (e.g. one button or one label). Use spacing tokens directly.

Do / Don't

Do

Apply a descriptive heading inside the container header so screen readers can announce the section.

Don't

Leave containers without a label when they contain distinct functional content — unlabelled regions are confusing for assistive technology users.

Do

Use the outlined or filled-subtle variant consistently across a page to indicate related groupings.

Don't

Mix container variants arbitrarily on the same page — inconsistent boundaries make hierarchy harder to parse.

Do

Keep container padding consistent using --op-space-16 (16px) or --op-space-24 (24px) for body regions.

Don't

Use arbitrary pixel values or mix padding scales within the same container family.

Do

For loading states, retain the container shell (header, footer) and load body content in place.

Don't

Destroy and re-render the entire container on data refresh — this causes layout shift and loses scroll position.

Was this page helpful?

Updated 9 September 2026