---
title: VStack
framework: swiftui
role: symbol
role_heading: Structure
path: swiftui/vstack
---

# VStack

A view that arranges its subviews in a vertical line.

## Declaration

```swift
@frozen nonisolated struct VStack<Content> where Content : View
```

## Mentioned in

Building layouts with stack views Creating performant scrollable stacks Adding a background to your view Inspecting view layout Picking container views for your content Aligning views across stacks Aligning views within a stack Applying Liquid Glass to custom views Configuring views Declaring a custom view

## Overview

Overview Unlike LazyVStack, which only renders the views when your app needs to display them, a VStack renders the views all at once, regardless of whether they are on- or offscreen. Use the regular VStack when you have a small number of subviews or don’t want the delayed rendering behavior of the “lazy” version. The following example shows a simple vertical stack of 10 text views: var body: some View {     VStack(         alignment: .leading,         spacing: 10     ) {         ForEach(             1...10,             id: \.self         ) {             Text("Item \($0)")         }     } }

note: If you need a vertical stack that conforms to the Layout protocol, like when you want to create a conditional layout using AnyLayout, use VStackLayout instead.

## Topics

### Creating a stack

- [init(alignment:spacing:content:)](swiftui/vstack/init(alignment:spacing:content:).md)

## Relationships

### Conforms To

- [View](swiftui/view.md)

## See Also

### Statically arranging views in one dimension

- [Building layouts with stack views](swiftui/building-layouts-with-stack-views.md)
- [HStack](swiftui/hstack.md)
