Stack

OverviewExamplesPropertiesSlotsCSS PropertiesUsageIntegration

Stack component manages layout of immediate children along the vertical or horizontal axis with optional spacing between each child.

Properties

PropertyAttribute Description TypeDefault
gapgapThe space injected between components.'none' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl''m'
directiondirectionThe direction of the stack.'vertical' | 'horizontal''vertical'
alignItemsalign-itemsHow to align the child items inside the stack.| 'center' | 'start' | 'end' | 'baseline' | 'stretch' | undefined'stretch'
wrapwrapDefines whether the Stack items are forced in a single line or can be flowed into multiple lines.booleanfalse
justifyContentjustify-contentHow to justify the child items inside the stack.| 'center' | 'start' | 'end' | 'space-between' | 'space-around' | 'space-evenly' | undefined

Slots

Slot name Description
Default slotThe stack content.

CSS Properties

CSS Custom Properties provide more fine grain control over component presentation. We advise utilizing existing properties on the component before using these.

PropertyDescriptionDefault
--n-stack-gapControls the spacing between items, using our spacing tokens.var(--n-space-m)

Usage

This section includes guidelines for designers and developers about the usage of this component in different contexts.

Do

  • Use when you need to stack multiple components vertically or horizontally.
  • Use when you want to adjust the white space between two or more components.

Don’t

  • Don’t use for building grid based layouts.

Integration

For integration guidelines, please see Web Components documentation .

Was this page helpful?

Yes No

We use this feedback to improve our documentation.