Overview
.flex and .inline-flex start a flex formatting context. Use .flex for full-width toolbars, sections, and grids; use .inline-flex when the container should sit in inline flow (chips, badges in copy, compact controls next to text). Add one of these on the parent before direction, wrap, gap, justify, or alignment helpers.
| Class | CSS | Use |
|---|---|---|
.flex | display: flex; | Block-level flex container (default choice for layouts) |
.inline-flex | display: inline-flex; | Inline flex container (flows with text and sibling inlines) |
Horizontal Layout
Adding.flex to a container lays its children out in a horizontal row by default.
Vertical Layout
Pair.flex with .flex-col to stack children vertically. This is useful for form groups, card bodies, and sidebar navigation.
Inline flex
.inline-flex behaves like .flex for children (row by default, works with flex-col, gap-*, alignment utilities) but the box itself is inline, so it can sit beside text or other inline content without forcing a new block row.
Responsive Variants
The framework ships structural breakpoint variants for both display modes:.flex--on-*
.flex--on-xs.flex--on-s.flex--on-m.flex--on-l.flex--on-xl.flex--on-xxl
.inline-flex--on-*
.inline-flex--on-xs.inline-flex--on-s.inline-flex--on-m.inline-flex--on-l.inline-flex--on-xl.inline-flex--on-xxl
Best Practices
- Add
.flexor.inline-flexat the container level, not on the children. - Keep spacing with
gap-*on the parent instead of margins on each child. - Switch to responsive
--on-*helpers when the layout should only become flex (or inline-flex) at certain breakpoints. - Prefer
.inline-flexover.flexwhen the flex container must share a line with text or stay as wide as its content in inline layout.
Related Utilities
Display
Block, inline-block, hidden, and other display modes
Flex Basis
Initial main-axis size for flex items
Flex Direction
Choose row, column, and reverse flow
Flex Wrap
Keep items on one line or wrap them
Gap
Add container-owned spacing between children
Responsive Utilities
Review the full shipped
--on-* system
