<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/AttributeScopes/SwiftUIAttributes",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation15AttributeScopesO7SwiftUIE0D12UIAttributesV"
  },
  "title" : "AttributeScopes.SwiftUIAttributes"
}
-->

# AttributeScopes.SwiftUIAttributes

Attribute scopes that SwiftUI defines.

```
struct SwiftUIAttributes
```

## Topics

### Using Color Attributes

[`backgroundColor`](/documentation/Foundation/AttributeScopes/SwiftUIAttributes/backgroundColor)

A property for accessing a background color attribute.

[`foregroundColor`](/documentation/Foundation/AttributeScopes/SwiftUIAttributes/foregroundColor)

A property for accessing a foreground color attribute.

### Using Font and Layout Attributes

[`font`](/documentation/Foundation/AttributeScopes/SwiftUIAttributes/font)

A property for accessing a font attribute.

[`tracking`](/documentation/Foundation/AttributeScopes/SwiftUIAttributes/tracking)

A property for accessing a tracking attribute.

### Using Text Styling Attributes

[`baselineOffset`](/documentation/Foundation/AttributeScopes/SwiftUIAttributes/baselineOffset)

A property for accessing a baseline offset attribute.

[`kern`](/documentation/Foundation/AttributeScopes/SwiftUIAttributes/kern)

A property for accessing a kerning attribute.

### Using Foundation Attributes

[`foundation`](/documentation/Foundation/AttributeScopes/SwiftUIAttributes/foundation)

A property for accessing attributes defined by the Foundation framework.

### Encoding and Decoding

  <doc:attributescopes/swiftuiattributes/decodingconfiguration>

  <doc:attributescopes/swiftuiattributes/encodingconfiguration>

## Relationships

### Conforms To

[`AttributeScope`](/documentation/Foundation/AttributeScope)

[`DecodingConfigurationProviding`](/documentation/Foundation/DecodingConfigurationProviding)

[`EncodingConfigurationProviding`](/documentation/Foundation/EncodingConfigurationProviding)

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

---

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)