SwiftUI.cc
Compare
CompareBeginner

SwiftUI VStack vs LazyVStack: When to Use Each

Use VStack for small static content and LazyVStack for large dynamic lists to optimize performance.

5 min readUpdated 2026-06

Quick Summary

Dimension VStack LazyVStack
Performance Lower for large content Better for large lists
Use case Small static content Large dynamic lists
iOS minimum iOS 13 iOS 14
Complexity Simple Slightly more complex
Flexibility Less More

VStack — When to Use

VStack is a basic vertical layout container that arranges its children immediately and all at once. It's ideal for small, static content like forms, settings, or UI components that don't change often.

It's simple and works on iOS 13 and above, making it a go-to for straightforward UI layouts.

// Using VStack
struct ContentView: View {
    var body: some View {
        VStack {
            Text("Item 1")
            Text("Item 2")
            Text("Item 3")
        }
    }
}

LazyVStack — When to Use

LazyVStack defers loading of views until they're needed — a performance optimization for large or dynamic content. It's especially useful when rendering long lists or when content depends on dynamic data.

Since it only creates views when they’re about to appear on screen, it reduces memory usage and improves performance in scrollable interfaces.

// Using LazyVStack
struct ContentView: View {
    var body: some View {
        ScrollView {
            LazyVStack {
                ForEach(0..<100) {
                    Text("Item \$0)")
                }
            }
        }
    }
}

Side-by-Side Example

Here's the same list of 10 items rendered using both VStack and LazyVStack:

// Using VStack
struct ContentView: View {
    var body: some View {
        VStack {
            ForEach(0..<10) {
                Text("Item \$0)")
            }
        }
    }
}
// Using LazyVStack
struct ContentView: View {
    var body: some View {
        ScrollView {
            LazyVStack {
                ForEach(0..<10) {
                    Text("Item \$0)")
                }
            }
        }
    }
}

While both render the same output, the LazyVStack version wraps in a ScrollView and defers layout until needed.

Decision Guide

Use VStack when building small, static UI components with minimal performance impact. Use LazyVStack when working with large, dynamic content inside a ScrollView to improve performance and memory efficiency.