---
title: HStackLayout
framework: swiftui
role: symbol
role_heading: Structure
path: swiftui/hstacklayout
---

# HStackLayout

A horizontal container that you can use in conditional layouts.

## Declaration

```swift
@frozen struct HStackLayout
```

## Overview

Overview This layout container behaves like an HStack, but conforms to the Layout protocol so you can use it in the conditional layouts that you construct with AnyLayout. If you don’t need a conditional layout, use HStack instead.

## Topics

### Creating a horizontal stack

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

### Getting the stack’s properties

- [alignment](swiftui/hstacklayout/alignment.md)
- [spacing](swiftui/hstacklayout/spacing.md)

## Relationships

### Conforms To

- [Animatable](swiftui/animatable.md)
- [BitwiseCopyable](swift/bitwisecopyable.md)
- [Copyable](swift/copyable.md)
- [Layout](swiftui/layout.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Transitioning between layout types

- [AnyLayout](swiftui/anylayout.md)
- [VStackLayout](swiftui/vstacklayout.md)
- [ZStackLayout](swiftui/zstacklayout.md)
- [GridLayout](swiftui/gridlayout.md)
