跳到主要内容

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.

结果
Loading...
实时编辑器

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.

结果
Loading...
实时编辑器

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

结果
Loading...
实时编辑器

And with vertical rules:

结果
Loading...
实时编辑器

Examples

Use a vertical Stack to stack buttons and other elements:

结果
Loading...
实时编辑器

Create an inline form with a horizontal Stack:

结果
Loading...
实时编辑器

API

Stack