<!--
{
  "availability" : [
    "macOS: 10.15.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSRectAlignment",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:@E@NSRectAlignment"
  },
  "title" : "NSRectAlignment"
}
-->

# NSRectAlignment

Constants that specify alignment to an edge or a set of edges depending on the user interface layout direction.

```
enum NSRectAlignment
```

## Topics

### Alignments

[`case none`](/documentation/AppKit/NSRectAlignment/none)

Has no specified alignment.

[`case top`](/documentation/AppKit/NSRectAlignment/top)

Aligns to the top edge.

[`case topLeading`](/documentation/AppKit/NSRectAlignment/topLeading)

Aligns to the top and leading edges.

[`case leading`](/documentation/AppKit/NSRectAlignment/leading)

Aligns to the leading edge.

[`case bottomLeading`](/documentation/AppKit/NSRectAlignment/bottomLeading)

Aligns to the bottom and leading edges.

[`case bottom`](/documentation/AppKit/NSRectAlignment/bottom)

Aligns to the bottom edge.

[`case bottomTrailing`](/documentation/AppKit/NSRectAlignment/bottomTrailing)

Aligns to the bottom and trailing edges.

[`case trailing`](/documentation/AppKit/NSRectAlignment/trailing)

Aligns to the trailing edge.

[`case topTrailing`](/documentation/AppKit/NSRectAlignment/topTrailing)

Aligns to the top and trailing edges.

### Initializers

[`init?(rawValue: Int)`](/documentation/AppKit/NSRectAlignment/init(rawValue:))

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Equatable`](/documentation/Swift/Equatable)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

[`Hashable`](/documentation/Swift/Hashable)

[`Sendable`](/documentation/Swift/Sendable)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)