domestic-ui GitHub

Stack

Vertical flow with a consistent gap between children.

Where a stack is used A stack is the vertical flow of a page or form in the content area: heading, text, a field and a button with the same gap between each.

Live example

Stack

<div class="stack" style="--stack-gap: var(--dui-space-xs)">
  <p>Stack item one</p>
  <p>Stack item two, with <code>--stack-gap: var(--dui-space-xs)</code></p>
  <p>Stack item three</p>
</div>

API

Attribute or valueEffect
class="stack"
--stack-gapspace between children (default: var(--dui-space-m))

Pattern: "The Stack", Every Layout, built with flexbox gap.

--stack-gap does not inherit, so nested stacks keep their own default.

Specifications

See also

How other systems do it

For comparison only; these are not the standard this system follows.

  • Apple Human Interface Guidelines: No equivalent
  • Material Design 3: No equivalent
  • Vercel Geist: No equivalent

Search