---
title: LazyHStack
framework: swiftui
role: symbol
role_heading: Structure
path: swiftui/lazyhstack
---

# LazyHStack

A view that arranges its children in a line that grows horizontally, creating items only as needed.

## Declaration

```swift
nonisolated struct LazyHStack<Content> where Content : View
```

## Mentioned in

Creating performant scrollable stacks Grouping data with lazy stack views Picking container views for your content

## Overview

Overview The stack is “lazy,” in that the stack view doesn’t create items until it needs to render them onscreen. In the following example, a ScrollView contains a LazyHStack that consists of a horizontal row of text views. The stack aligns to the top of the scroll view and uses 10-point spacing between each text view. ScrollView(.horizontal) {     LazyHStack(alignment: .top, spacing: 10) {         ForEach(1...100, id: \.self) {             Text("Column \($0)")         }     } }

## Topics

### Creating a lazy-loading horizontal stack

- [init(alignment:spacing:pinnedViews:content:)](swiftui/lazyhstack/init(alignment:spacing:pinnedviews:content:).md)

## Relationships

### Conforms To

- [View](swiftui/view.md)

## See Also

### Dynamically arranging views in one dimension

- [Grouping data with lazy stack views](swiftui/grouping-data-with-lazy-stack-views.md)
- [Creating performant scrollable stacks](swiftui/creating-performant-scrollable-stacks.md)
- [LazyVStack](swiftui/lazyvstack.md)
- [PinnedScrollableViews](swiftui/pinnedscrollableviews.md)
