Skip to content
Alpha

Hololink UI is under active development. Components, APIs and these docs may change without notice.

Holo Container

The <holo-container> component centers its content within a maximum width, optionally applying horizontal inset padding.

Use it for:

  • Constraining content to a readable maximum width (sm to xl, or full) and centring it.
  • Adding consistent inline padding at the edge of the page or a section.

Don’t use it for:

  • Arranging children in rows or columns. Use Stack or Grid.
  • A visible surface with a border or shadow. Use Card.
  • Marking up page landmarks. It carries no semantics.

Content constrained to a large max-width.

<holo-container max-width="lg" padded>
<div>Content constrained to a large max-width.</div>
</holo-container>

A narrower container.

<holo-container max-width="sm">
<div>A narrower container.</div>
</holo-container>

The container is a purely presentational layout element. It renders a slot with no role, no landmark and no focus behaviour, so it has no effect on the accessibility tree.

You provide:

  • Real landmarks and headings. Put <main>, <header>, <nav> and heading elements inside (or around) the container.
  • Content that still works at 320 CSS px wide and at 400% zoom. Avoid fixed widths inside the container.

Importing

import '@philbob-sideprojects/hololink-ui/holo-container';

Properties

PropertyAttributeTypeDefaultDescription
maxWidthmax-width"full" | "lg" | "md" | "sm" | "xl"'lg'The maximum width of the container's content area.
paddedpaddedbooleantrueIf true, applies horizontal inset padding to the container.

Slots

SlotDescription
(default)The content to center and constrain.

CSS custom properties

PropertyDescription
--holo-container-max-width-lgMaximum width when max-width="lg".
--holo-container-max-width-mdMaximum width when max-width="md".
--holo-container-max-width-smMaximum width when max-width="sm".
--holo-container-max-width-xlMaximum width when max-width="xl".
--holo-container-paddingHorizontal inset padding applied when padded is true.