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="flex-start">
<Heading fontSize="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";