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

# top

A guide that marks the top edge of the view.

## Declaration

```swift
static let top: VerticalAlignment
```

## Mentioned in

Laying out a simple view

## Discussion

Discussion Use this guide to align the top edges of views:

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

## See Also

### Getting guides

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