Stack component is a layout component that stacks its children vertically or horizontally.
Default stack is using vertical direction with a gap of --dds-spacing-600
/ 24px between its children.
You can set the direction
to row
or row-reverse
to stack the children horizontally.
Horizontal stack is using the gap of --dds-spacing-200
/ 8px between its children.
You can set the spacing
to a custom value to adjust the space between the children. Any dds-spacing-
variable number can be used.
import { DapDSStack } from 'dap-design-system/dist/dds'
import { DapDSStackReact } from 'dap-design-system/dist/react'
Property | Type | Default | Description |
---|---|---|---|
direction | 'column' , 'column-reverse' , 'row' , 'row-reverse' | 'column' | The direction of the stack. |
endMargin | boolean , undefined | false | Adds margin to the end of the stack. |
startMargin | boolean , undefined | false | Adds margin to the start of the stack. |
spacing | The spacing of the stack. Uses the system spacing scale (100, 200, 300...etc) |
Name | Description |
---|---|
(default) | The content of the stack. |
No custom events available.
Part Name | Description |
---|---|
stack | The main stack container. |
No CSS custom properties available.