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

# NSLayoutConstraint.Attribute

The part of the object’s visual representation that should be used to get the value for the constraint.

```
enum Attribute
```

## Topics

### Constants

[`case left`](/documentation/AppKit/NSLayoutConstraint/Attribute/left)

The left side of the object’s alignment rectangle.

[`case right`](/documentation/AppKit/NSLayoutConstraint/Attribute/right)

The right side of the object’s alignment rectangle.

[`case top`](/documentation/AppKit/NSLayoutConstraint/Attribute/top)

The top of the object’s alignment rectangle.

[`case bottom`](/documentation/AppKit/NSLayoutConstraint/Attribute/bottom)

The bottom of the object’s alignment rectangle.

[`case leading`](/documentation/AppKit/NSLayoutConstraint/Attribute/leading)

The leading edge of the object’s alignment rectangle.

[`case trailing`](/documentation/AppKit/NSLayoutConstraint/Attribute/trailing)

The trailing edge of the object’s alignment rectangle.

[`case width`](/documentation/AppKit/NSLayoutConstraint/Attribute/width)

The width of the object’s alignment rectangle.

[`case height`](/documentation/AppKit/NSLayoutConstraint/Attribute/height)

The height of the object’s alignment rectangle.

[`case centerX`](/documentation/AppKit/NSLayoutConstraint/Attribute/centerX)

The center along the x-axis of the object’s alignment rectangle.

[`case centerY`](/documentation/AppKit/NSLayoutConstraint/Attribute/centerY)

The center along the y-axis of the object’s alignment rectangle.

[`case lastBaseline`](/documentation/AppKit/NSLayoutConstraint/Attribute/lastBaseline)

The object’s baseline.

[`case firstBaseline`](/documentation/AppKit/NSLayoutConstraint/Attribute/firstBaseline)

The object’s baseline.

[`case notAnAttribute`](/documentation/AppKit/NSLayoutConstraint/Attribute/notAnAttribute)

A placeholder value for indicating that the constraint’s second item and second attribute aren’t used in any calculations.

### Initializers

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

## Relationships

### Conforms To

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

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

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

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

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

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

---

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)