<!--
{
  "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" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Text/LineStyle",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4TextV9LineStyleV"
  },
  "title" : "Text.LineStyle"
}
-->

# Text.LineStyle

Description of the style used to draw the line for `StrikethroughStyleAttribute`
and `UnderlineStyleAttribute`.

```
struct LineStyle
```

## Overview

Use this type to specify `underlineStyle` and `strikethroughStyle`
SwiftUI attributes of an `AttributedString`.

## Topics

### Getting text line styles

[`single`](/documentation/SwiftUI/Text/LineStyle/single)

Draw a single solid line.

### Creating a text line style

[`init(nsUnderlineStyle:)`](/documentation/SwiftUI/Text/LineStyle/init(nsUnderlineStyle:))

Creates a `Text.LineStyle` from `NSUnderlineStyle`.

[`init(pattern:color:)`](/documentation/SwiftUI/Text/LineStyle/init(pattern:color:))

Creates a line style.

[`Pattern`](/documentation/SwiftUI/Text/LineStyle/Pattern)

The pattern, that the line has.

## Relationships

### Conforms To

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

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

[`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)