Build faster with Premium Chakra UI Components 💎

Learn more
Skip to Content
DocsPlaygroundGuidesBlog
Sponsor

Stack

Used to layout its children in a vertical or horizontal stack.

Source

Usage

By default, Stack applies flex-direction: column and gap: 8px to its children.

import { HStack, Stack, VStack } from "@chakra-ui/react"
<Stack>
  <div />
  <div />
</Stack>

Examples

Horizontal

Use the direction prop to change the direction of the stack.

HStack

Alternatively, you can use the HStack to create a horizontal stack and align its children horizontally.

VStack

Use the VStack to create a vertical stack and align its children vertically.

Separator

Use the separator prop to add a separator between the stack items.

Responsive Direction

Use the direction prop to change the direction of the stack responsively.

Previous

SimpleGrid

Next

Theme