Get your own website
Demo.swift
ContentView.swift
App.swift
 
import SwiftUI

struct LazyStacksDemo: View {
  var body: some View {
    ScrollView {
      LazyVStack(spacing: 8) {
        ForEach(1...100, id: \.self) { i in
          Text("Row \(i)").frame(maxWidth: .infinity, alignment: .leading).padding(8)
            .background(.gray.opacity(0.1)).cornerRadius(6)
        }
      }.padding()
    }
  }
}

                    
import SwiftUI

struct ContentView: View {
  var body: some View { LazyStacksDemo() }
}

                    
import SwiftUI

@main
struct MyApp: App {
  var body: some Scene { WindowGroup { ContentView() } }
}