This is an illustration of a Themed VStack component with default configuration.
space
reversed
<Box h="$80" justifyContent="center">
<VStack space="md" reversed={false}>
<Box w="$20" h="$20" bg="$blue300" />
<Box w="$20" h="$20" bg="$blue400" />
<Box w="$20" h="$20" bg="$blue500" />
</VStack>
</Box>

API Reference

Import

To use this component in your project, include the following import statement in your file.
import { VStack } from "@gluestack-ui/themed"

Anatomy

The structure provided below can help you identify and understand a VStack component's various parts.
export default () => <VStack />

Component Props

This section provides a comprehensive reference list for the component props, detailing descriptions, properties, types, and default behavior for easy project integration.

VStack

It inherits all the properties of React Native's View component.

Accessibility

The accessibility of a VStack is primarily determined by the accessibility information of the components it contains. When you pass an accessible component inside a VStack, its accessibility attributes, such as labels and hints, will be utilized by assistive technologies like screen readers.
In essence, the VStack acts as a container that inherits and propagates the accessibility attributes of its child views.

Themed

The themed version of the component is a pre-styled version of the component, which allows you to quickly integrate the component into your project. The component's design and functionality are fully defined, allowing you to focus on the more important aspects of your project. To know more about Themed Library please visit this link.

Props

VStack component is created using View component from react-native. It extends all the props supported by React Native View, utility props and the props mentioned below.

VStack

Prop
Type
Default
Description
space
string
-
It sets the space between children.
reversed
boolean
-
When true, it places the VStack items in reverse direction.
Note: These props are exclusively applicable when utilizing the default configuration of gluestack-ui/config. If you are using a custom theme, these props may not be available.

Examples

The Examples section provides visual representations of the different variants of the component, allowing you to quickly and easily determine which one best fits your needs. Simply copy the code and integrate it into your project.

VStack Reversed

A VStack component with the reversed prop reverses the order of vertically stacked elements, enabling customized vertical layouts and visual arrangements of content within a user interface.
<VStack space="md">
<Box w="$20" h="$20" bg="$blue300" />
<Box w="$20" h="$20" bg="$blue400" />
<Box w="$20" h="$20" bg="$blue500" />
</VStack>

Unstyled

All the components in gluestack-ui are unstyled by default. To customize your UI using the extendedTheme, please refer to this link. The import names of components serve as keys to customize each component.

Spec Doc

Explore the comprehensive details of the VStack in this document, including its implementation details, checklist, and potential future additions. Dive into the thought process behind the component and gain insights into its development journey.