Stack
To implement the Stack component into your project you’ll need to add the import:
import Stack from "@kiwicom/orbit-components/lib/Stack";
After adding import to your project you can use it simply like:
<Stack><Button>My button</Button><Button iconRight={<ChevronDown />} /></Stack>
Props
The table below contains all types of props available in the Stack component.
| Name | Type | Default | Description | 
|---|---|---|---|
| as | string | "div" | The string used for the root node. | 
| align | enum | "start" | The align-itemsandalign-contentof the Stack. | 
| basis | string | auto | Specifies the basis value of flex-basis. | 
| children | React.Node | Content of the Stack. | |
| dataTest | string | Optional prop for testing purposes. | |
| desktop | Object | Object for setting up properties for the desktop viewport. See Media queries | |
| direction | enum | The flex-directionof the Stack. See Functional specs | |
| flex | boolean | false | If trueor you specify some flex attribute, the Stack will use flex attributes. | 
| grow | boolean | true | If true, the Stack will haveflex-growset to1, otherwise it will be0. | 
| inline | boolean | false | If true, the Stack will havedisplayset toinline-flex. | 
| justify | enum | "start" | The justify-contentof the Stack. | 
| largeDesktop | Object | Object for setting up properties for the largeDesktop viewport. See Media queries | |
| largeMobile | Object | Object for setting up properties for the largeMobile viewport. See Media queries | |
| mediumMobile | Object | Object for setting up properties for the mediumMobile viewport. See Media queries | |
| shrink | boolean | false | If true, the Stack will haveflex-shrinkset to1. | 
| spacing | spacing | "medium" | The spacing between its children. | 
| spaceAfter | enum | Additional paddingto bottom of the Stack. | |
| tablet | Object | Object for setting up properties for the tablet viewport. See Media queries | |
| wrap | boolean | false | If true, the Stack will haveflex-wrapset towrap, otherwise it will benowrap. | 
| useMargin | boolean | false | If true, the Stack will be using margins instead of gap | 
Media Queries
When you need to specify some different behavior of the Stack component on different viewports, you can use properties for it.
There are mediumMobile, largeMobile, tablet, desktop and largeDesktop available and it behaves the same as mediaQueries functions.
All these properties - objects have the same own properties and none is required.
| Name | Type | Default | Description | 
|---|---|---|---|
| align | enum | "start" | The align-itemsandalign-contentof the Stack. | 
| basis | string | auto | Specifies the basis value of flex-basis. | 
| direction | enum | "row" | The flex-directionof the Stack. | 
| grow | boolean | true | If true, the Stack will haveflex-growset to1, otherwise it will be0. | 
| inline | boolean | false | If true, the Stack will havedisplayset toinline-flex, otherwise it will beflex. | 
| justify | enum | "start" | The justify-contentof the Stack. | 
| shrink | boolean | true | If false, the Stack will haveflex-shrinkset to0. | 
| spacing | spacing | The spacing between its children. | |
| spaceAfter | enum | Additional paddingto bottom of the Stack. | |
| wrap | boolean | false | If true, the Stack will haveflex-wrapset towrap, otherwise it will benowrap. | 
Functional specs
- The default behavior for the - Stackcomponent is to not be a- flexboxcontainer. It means that by default it’s nesting children natively (below each other) and it won’t use any- flexCSS properties.
- If you specify some property (except children, spaceAfter, dataTest and spacing) it will become a - flexboxcontainer and the- flex-direction: rowwill be used.
enum
| justify | direction | align | spaceAfter | 
|---|---|---|---|
| "start" | "row" | "start" | "none" | 
| "end" | "column" | "end" | "smallest" | 
| "center" | "row-reverse" | "center" | "small" | 
| "between" | "column-reverse" | "stretch" | "normal" | 
| "around" | "medium" | ||
| "large" | |||
| "largest" | 
spacing
| name | size on 992px - ∞ | 
|---|---|
| "none" | null | 
| "50" | 2px | 
| "100" | 4px | 
| "150" | 6px | 
| "200" | 8px | 
| "300" | 12px | 
| "400" | 16px | 
| "500" | 20px | 
| "600" | 24px | 
| "800" | 32px | 
| "1000" | 40px | 
| "1200" | 48px | 
| "1600" | 64px |