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

# AttributeScopes.SwiftUIAttributes.UnderlineStyleAttribute

A key for the line drawn under a run of attributed text.

```
@frozen enum UnderlineStyleAttribute
```

## Overview

Set this key to underline part of a string, such as a term that leads
somewhere. The value carries both the pattern and the color of the line:

```
var terms = AttributedString("Terms of Service")
terms.underlineStyle = .single

Text(terms)
```

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

---

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)