Stack
<Stack />
is a wrapper component that adds margins between child components using this hack:
/* adds margin between all immediate child elements that are adjacent */.stack > * + * {margin-top: 1.5rem;}
Also inspired by Chakra UI.
import { Stack } from 'minerva-ui'
Usage
Preview
Item 1
Item 2
Item 3
Source
Horizontal Stack
Preview
Item 1
Item 2
Item 3
Source
Custom Gap
Preview
Item 1
Item 2
Item 3
Source
Props
These are props related to the Stack component.
Name | Type | Is Required | Default | Description |
---|---|---|---|---|
gap | string | optional | 10px | Space between items in stack |
horizontal | boolean | optional | false | Change stack direction to horizontal |