Skip to content

Layout overview

Sprout provides four layout primitives: container, grid, stack, and cluster. Use them together to build pages without custom layout CSS.

PrimitivePurpose
ContainerConstrain width and center content; optional .narrow / .wide.
GridMulti-column layout; use .cols-2, .cols-3, or .cols-4.
StackVertical stacking with consistent gap; use .gap-* modifiers.
ClusterHorizontal grouping that wraps; use for buttons, tags, toolbars.

Quick example

html
<div class="container">
  <div class="stack gap-4">
    <h2>Section</h2>
    <div class="grid cols-3">
      <div class="card">Card 1</div>
      <div class="card">Card 2</div>
      <div class="card">Card 3</div>
    </div>
    <div class="cluster gap-3">
      <button>Save</button>
      <button class="outline">Cancel</button>
    </div>
  </div>
</div>

Section

Card 1

Card 2

Card 3

See also

MIT License · Lightweight by principle. Sustainable by design.