Skip to main content

Stacks

Shorthand helpers that build on top of our flexbox utilities to make component layout faster and easier than ever.

Vertical

Stacks are vertical by default and stacked items are full-width by default. Use the gap prop to add space between items.

Result
Loading...
Live Editor

Horizontal

Use direction="horizontal" for horizontal layouts. Stacked items are vertically centered by default and only take up their necessary width. Use the gap prop to add space between items.

Result
Loading...
Live Editor

Using horizontal margin utilities like .ms-auto as spacers:

Result
Loading...
Live Editor

And with vertical rules:

Result
Loading...
Live Editor

Examples

Use a vertical Stack to stack buttons and other elements:

Result
Loading...
Live Editor

Create an inline form with a horizontal Stack:

Result
Loading...
Live Editor

API

Stack