<!--
{
  "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

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

The left side of the object’s alignment rectangle.

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

The right side of the object’s alignment rectangle.

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

The top of the object’s alignment rectangle.

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

The bottom of the object’s alignment rectangle.

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

The leading edge of the object’s alignment rectangle.

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

The trailing edge of the object’s alignment rectangle.

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

The width of the object’s alignment rectangle.

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

The height of the object’s alignment rectangle.

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

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

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

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

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

The object’s baseline.

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

The object’s baseline.

[`NSLayoutAttributeNotAnAttribute`](/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.

## Relationships

### Conforms To

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

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

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

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

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

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

---

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)