Cluster

A flexbox row that wraps its children with a consistent gap. Use it for button groups, tag lists, meta lines, and toolbars.

Default cluster

index.htmlhtml
<div class="ln-cluster">
  <span class="bg-surface-raised rounded-sm p-1 px-2">Design</span>
  <span class="bg-surface-raised rounded-sm p-1 px-2">Tokens</span>
  <span class="bg-surface-raised rounded-sm p-1 px-2">Vertical Rhythm</span>
  <span class="bg-surface-raised rounded-sm p-1 px-2">SCSS</span>
  <span class="bg-surface-raised rounded-sm p-1 px-2">BEM</span>
</div>
DesignTokensVertical RhythmSCSSBEM

Justify and alignment modifiers

index.htmlhtml
<!-- Space between -->
<div class="ln-cluster ln-cluster--gap-md ln-cluster--justify-between mb-3">
  <span class="bg-surface-raised rounded-sm p-1 px-2">Left item</span>
  <span class="bg-surface-raised rounded-sm p-1 px-2">Right item</span>
</div>

<!-- Center-aligned -->
<div class="ln-cluster ln-cluster--nowrap ln-cluster--align-center">
  <strong>Title</strong>
  <span class="text-muted text-body-sm">Centered subtitle</span>
</div>
Left itemRight item
TitleCentered subtitle

Responsive layout

Justify, align, and nowrap modifiers accept a @{breakpoint} suffix for responsive behaviour.

index.htmlhtml
<!-- Centred on mobile, space-between from md up -->
<div class="ln-cluster ln-cluster--gap-md ln-cluster--justify-center ln-cluster--justify-between@md border p-2 mb-3">
  <span class="bg-surface-raised rounded-sm p-1 px-2">Left</span>
  <span class="bg-surface-raised rounded-sm p-1 px-2">Right</span>
</div>

<!-- Wraps on mobile, nowrap from lg up -->
<div class="ln-cluster ln-cluster--gap-sm ln-cluster--nowrap@lg border p-2">
  <span class="bg-surface-raised rounded-sm p-1 px-2">One</span>
  <span class="bg-surface-raised rounded-sm p-1 px-2">Two</span>
  <span class="bg-surface-raised rounded-sm p-1 px-2">Three</span>
  <span class="bg-surface-raised rounded-sm p-1 px-2">Four</span>
  <span class="bg-surface-raised rounded-sm p-1 px-2">Five</span>
</div>
LeftRight
OneTwoThreeFourFive

Reference

ClassDescriptionResponsive
.ln-clusterFlex row with wrap and default 8px gapNo
.ln-cluster--gap-xs8px gapNo
.ln-cluster--gap-sm16px gapNo
.ln-cluster--gap-md24px gapNo
.ln-cluster--justify-startJustify items to startYes
.ln-cluster--justify-centerJustify items to centreYes
.ln-cluster--justify-endJustify items to endYes
.ln-cluster--justify-betweenSpace between itemsYes
.ln-cluster--align-startAlign items to startYes
.ln-cluster--align-centerAlign items to centreYes
.ln-cluster--align-baselineAlign items to baselineYes
.ln-cluster--align-endAlign items to endYes
.ln-cluster--nowrapPrevent wrappingYes