Skip to main content

VStack

VStack is a convenience wrapper around Stack with a fixed vertical (column) direction. Use it for vertical layouts.

Open in Storybook

Import​

import { VStack } from "@tosui/react";

Basic usage​

Alignment​

Centered
Items
Here

Common patterns​

Form layout​

<VStack gap={4} align="stretch">
<Input placeholder="Name" />
<Input placeholder="Email" />
<Textarea placeholder="Message" />
<Button>Submit</Button>
</VStack>

Card content​

<Card>
<CardBody>
<VStack gap={3} align="start">
<Heading size="xl">Card Title</Heading>
<Text color="foreground-muted">Card description goes here.</Text>
<Button size="sm">Learn More</Button>
</VStack>
</CardBody>
</Card>

Props reference​

All convenience props (align, justify, wrap) accept responsive objects in addition to simple values.

PropTypeDefaultDescription
gapResponsiveValue<0-32>-Gap between children (spacing multiplier)
alignResponsiveValue<"start" | "center" | "end" | "stretch" | "baseline">-Cross-axis alignment
justifyResponsiveValue<"start" | "center" | "end" | "space-between" | "space-around" | "space-evenly">-Main-axis alignment
wrapResponsiveValue<boolean>falseEnable flex wrapping
asElementType"div"HTML element to render

VStack accepts all Stack props except direction.

TypeScript​

import { VStack, type VStackProps, type VStackOwnProps } from "@tosui/react";