Layout Docs

Flexbox Axes & Sizing

Flexbox distributes space along a single primary axis while aligning items across the perpendicular cross axis.

Toolbar With Trailing Action

.toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.toolbar-spacer {
  margin-inline-start: auto;
}

Preventing Flex Child Overflow

Flex items default to min-width: auto, which can force a row wider than its container when children hold long unbroken strings. Reset min-width: 0 on the shrinking pane.

.media-body {
  flex: 1 1 0%;
  min-width: 0;
}

Common Flex Shorthands

ShorthandExpandedEffect
flex: 11 1 0%Equal shares regardless of intrinsic content width
flex: auto1 1 autoGrows and shrinks proportional to content size
flex: none0 0 autoLocks width for icons, badges, and buttons