---
title: "init(alignment:)"
framework: swiftui
role: symbol
role_heading: Initializer
path: "swiftui/zstacklayout/init(alignment:)"
---

# init(alignment:)

Creates a stack with the specified alignment.

## Declaration

```swift
init(alignment: Alignment = .center)
```

## Parameters

- `alignment`: The guide for aligning the subviews in this stack on both the x- and y-axes.
