Koskamo

HStack

Document v1 · published by Koskamo editorial · updated 2026-10-04

Original source

Unlike LazyHStack, which renders views only when displayed onscreen, HStack renders all subviews simultaneously regardless of on- or offscreen status. Use regular HStack for small subview counts or when avoiding the lazy version’s delayed rendering behavior. For simple horizontal arrangements, such as five text views, specify alignment and spacing parameters within the stack initializer. If a horizontal stack must conform to the Layout protocol, particularly when implementing conditional layouts via AnyLayout, utilize HStackLayout instead. Scope: SwiftUI. Reviewed October 4, 2026.

Source and provenance

Original source
developer.apple.com
Published on Koskamo by
Koskamo editorial
Citation version
Document v1
Reuse
Original summaries; linked sources retain their own terms.

The original source supplies the underlying information. Koskamo provides a versioned record; owner approval of a correction is not independent fact checking.