Flex

Flexbox utility classes — display, direction, justify, align, wrap, gap, and auto margins.

Display

Flex Item 1
Flex Item 2
Flex Item 3
<div class="sui-d-flex sui-gap-2">
  <div>Flex Item 1</div>
  <div>Flex Item 2</div>
  <div>Flex Item 3</div>
</div>

Direction

sui-flex-row (default)
1
2
3
sui-flex-column
1
2
3
<div class="sui-d-flex sui-flex-row">...</div>
<div class="sui-d-flex sui-flex-column">...</div>

Justify Content

sui-justify-start
A
B
C
sui-justify-center
A
B
C
sui-justify-end
A
B
C
sui-justify-between
A
B
C
sui-justify-around
A
B
C
sui-justify-evenly
A
B
C
<div class="sui-d-flex sui-justify-start">...</div>
<div class="sui-d-flex sui-justify-center">...</div>
<div class="sui-d-flex sui-justify-end">...</div>
<div class="sui-d-flex sui-justify-between">...</div>
<div class="sui-d-flex sui-justify-around">...</div>
<div class="sui-d-flex sui-justify-evenly">...</div>

Align Items

sui-align-start
A
B
sui-align-center
A
B
sui-align-end
A
B
sui-align-stretch
A
B
<div class="sui-d-flex sui-align-start">...</div>
<div class="sui-d-flex sui-align-center">...</div>
<div class="sui-d-flex sui-align-end">...</div>
<div class="sui-d-flex sui-align-stretch">...</div>

Wrap

sui-flex-wrap
Item 1
Item 2
Item 3
Item 4
Item 5
sui-flex-nowrap
Item 1
Item 2
Item 3
Item 4
Item 5
<div class="sui-d-flex sui-flex-wrap">...</div>
<div class="sui-d-flex sui-flex-nowrap">...</div>

Grow & Shrink

Fixed
sui-flex-1 fills the rest

Overview

A short card.

Details

A longer card whose content wraps onto several lines, so this column is taller than the other one.
<!-- One item fills the remaining space -->
<div class="sui-d-flex sui-gap-2">
  <div class="sui-flex-none">Fixed</div>
  <div class="sui-flex-1">sui-flex-1 fills the rest</div>
</div>

<!-- Equal-height cards under headings that sit outside the cards -->
<div class="sui-d-flex sui-gap-3">
  <div class="sui-d-flex sui-flex-column sui-gap-2 sui-flex-1">
    <h4>Overview</h4>
    <div class="sui-card sui-flex-1">A short card.</div>
  </div>
  <div class="sui-d-flex sui-flex-column sui-gap-2 sui-flex-1">
    <h4>Details</h4>
    <div class="sui-card sui-flex-1">A longer card whose content wraps onto several lines, so this column is taller than the other one.</div>
  </div>
</div>

Gap

sui-gap-0 (0)
A
B
C
sui-gap-2 (8px)
A
B
C
sui-gap-4 (24px)
A
B
C
sui-gap-6 (64px)
A
B
C
<div class="sui-d-flex sui-gap-0">...</div>
<div class="sui-d-flex sui-gap-2">...</div>
<div class="sui-d-flex sui-gap-4">...</div>
<div class="sui-d-flex sui-gap-6">...</div>

Auto Margins

sui-ms-auto — push item to the end
Logo
Profile
sui-mx-auto — center horizontally
Centered
sui-me-auto — push others to the end
Left
Right 1
Right 2
sui-my-auto — center vertically
Middle
sui-mt-auto — push to the bottom of a column
Content
Footer
<!-- Push item to the end (right in LTR) -->
<div class="sui-d-flex">
  <div>Logo</div>
  <div class="sui-ms-auto">Profile</div>
</div>

<!-- Center horizontally -->
<div class="sui-d-flex">
  <div class="sui-mx-auto">Centered</div>
</div>

<!-- Push others to the end (right in LTR) -->
<div class="sui-d-flex">
  <div class="sui-me-auto">Left</div>
  <div>Right 1</div>
  <div>Right 2</div>
</div>

<!-- Center vertically -->
<div class="sui-d-flex" style="height:96px;">
  <div class="sui-my-auto">Middle</div>
</div>

<!-- Push to the bottom of a column -->
<div class="sui-d-flex sui-flex-column sui-gap-2" style="height:120px;">
  <div>Content</div>
  <div class="sui-mt-auto">Footer</div>
</div>

Reference

ClassDescription
sui-flex-1Grow and shrink from a zero basis: fills the remaining space, equal shares when several items use it.
sui-flex-autoGrow and shrink from the item's own size.
sui-flex-noneNeither grow nor shrink.
sui-flex-grow-0, sui-flex-grow-1Turn growing off or on.
sui-flex-shrink-0, sui-flex-shrink-1Turn shrinking off or on.
sui-gap-00, --sui-space-0.
sui-gap-14px, --sui-space-1.
sui-gap-28px, --sui-space-2.
sui-gap-316px, --sui-space-3.
sui-gap-424px, --sui-space-4.
sui-gap-548px, --sui-space-5.
sui-gap-664px, --sui-space-6.
sui-gap-796px, --sui-space-7.

Delete this item?

This action cannot be undone. This will permanently delete the item and remove all associated data.