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.

NameTypeIs RequiredDefaultDescription
gapstringoptional10pxSpace between items in stack
horizontalbooleanoptionalfalseChange stack direction to horizontal