<!--
{
  "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/BaselineOffsetAttribute",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Foundation",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:10Foundation15AttributeScopesO7SwiftUIE0D12UIAttributesV014BaselineOffsetB0O"
  },
  "title" : "AttributeScopes.SwiftUIAttributes.BaselineOffsetAttribute"
}
-->

# AttributeScopes.SwiftUIAttributes.BaselineOffsetAttribute

A key for the distance a run of attributed text shifts from its
baseline.

```
@frozen enum BaselineOffsetAttribute
```

## Overview

A positive value raises the run and a negative value lowers it, which
lets you set a unit or a footnote marker above the surrounding text:

```
var measure = AttributedString("12 m")
if let unit = measure.range(of: "m") {
    measure[unit].baselineOffset = 6
}

Text(measure)
```

Shifting a run does not change the height of the line, so a large offset
can push text into the line above or below.

## Relationships

### Conforms To

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

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

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

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

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

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

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

---

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)