Stack
A CSS flexbox component to help with the layout of elements on a page.
Basic Usage
import { Stack } from '@krakentech/coral';
<Stack>
<Card>Card 1</Card>
<Card>Card 2</Card>
<Card>Card 3</Card>
</Stack>Card 1
Card 2
Card 3
Properties
alignContent
<Stack alignContent="space-between" flexWrap="wrap" fullHeight>
<Card fullWidth>Card</Card>
<Card fullWidth>Card</Card>
<Card fullWidth>Card</Card>
</Stack>Card
Card
Card
alignItems
<Stack alignItems="flex-end">
<Typography>Typography</Typography>
<Card>Card</Card>
<Chip>Chip</Chip>
</Stack>Typography
Card
Chip
flexDirection
<Stack flexDirection="column">
<Card>Card 1</Card>
<Card>Card 2</Card>
<Card>Card 3</Card>
</Stack>Card 1
Card 2
Card 3
display
<Stack display="inline-flex">
<Card>Group 1</Card>
<Card>Group 1</Card>
<Card>Group 1</Card>
</Stack>
<Stack>
<Card>Group 2</Card>
<Card>Group 2</Card>
<Card>Group 2</Card>
</Stack>
<Stack display="inline-flex">
<Card>Group 3</Card>
<Card>Group 3</Card>
<Card>Group 3</Card>
</Stack>
<Stack display="inline-flex">
<Card>Group 4</Card>
<Card>Group 4</Card>
<Card>Group 4</Card>
</Stack>Group 1
Group 1
Group 1
Group 2
Group 2
Group 2
Group 3
Group 3
Group 3
Group 4
Group 4
Group 4
flexWrap
<Stack flexWrap="wrap">
<Card>Card</Card>
<Card>Card</Card>
<Card>Card</Card>
<Card>Card</Card>
<Card>Card</Card>
<Card>Card</Card>
<Card>Card</Card>
<Card>Card</Card>
<Card>Card</Card>
<Card>Card</Card>
<Card>Card</Card>
<Card>Card</Card>
</Stack>Card
Card
Card
Card
Card
Card
Card
Card
Card
Card
Card
Card
fullHeight
<div style={{ height: 600 }}>
<Stack flexDirection="column" fullHeight justifyContent="space-between">
<Card>Card 1</Card>
<Card>Card 2</Card>
<Card>Card 3</Card>
</Stack>
</div>Card 1
Card 2
Card 3
fullWidth
<Stack fullWidth justifyContent="space-between">
<Card>Card 1</Card>
<Card>Card 2</Card>
<Card>Card 3</Card>
</Stack>Card 1
Card 2
Card 3
gap
<Stack gap="xl">
<Card>Card 1</Card>
<Card>Card 2</Card>
<Card>Card 3</Card>
</Stack>Card 1
Card 2
Card 3
rowGap
<Stack rowGap="xxl" flexDirection="column">
<Card>Card 1</Card>
<Card>Card 2</Card>
<Card>Card 3</Card>
</Stack>Card 1
Card 2
Card 3
columnGap
<Stack columnGap="xxl">
<Card>Card 1</Card>
<Card>Card 2</Card>
<Card>Card 3</Card>
</Stack>Card 1
Card 2
Card 3
justifyContent
<Stack fullWidth justifyContent="flex-end">
<Card>Card 1</Card>
<Card>Card 2</Card>
<Card>Card 3</Card>
</Stack>Card 1
Card 2
Card 3
Responsiveness
This example will switch the direction and spacing of the cards starting at the medium breakpoint.
<Stack
flexDirection={{ base: "column", md: "row" }}
gap={{ md: "xxl" }}
>
<Card>Card 1</Card>
<Card>Card 2</Card>
<Card>Card 3</Card>
</Stack>Card 1
Card 2
Card 3
Full API
Last updated on