---
title: center
framework: swiftui
role: symbol
role_heading: Type Property
path: swiftui/verticalalignment/center
---

# center

A guide that marks the vertical center of the view.

## Declaration

```swift
static let center: VerticalAlignment
```

## Mentioned in

Aligning views across stacks

## Discussion

Discussion Use this guide to align the centers of views:

The following code generates the image above using an HStack: struct VerticalAlignmentCenter: View {     var body: some View {         HStack(alignment: .center, spacing: 0) {             Color.red.frame(height: 1)             Text("Center").font(.title).border(.gray)             Color.red.frame(height: 1)         }     } }

## See Also

### Getting guides

- [top](swiftui/verticalalignment/top.md)
- [bottom](swiftui/verticalalignment/bottom.md)
- [firstTextBaseline](swiftui/verticalalignment/firsttextbaseline.md)
- [lastTextBaseline](swiftui/verticalalignment/lasttextbaseline.md)
