<!--
{
  "availability" : [
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSUnderlineStyle",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:@E@NSUnderlineStyle"
  },
  "title" : "NSUnderlineStyle"
}
-->

# NSUnderlineStyle

Constants for the underline style and strikethrough style attribute keys.

```
struct NSUnderlineStyle
```

## Overview

Use these constants to specify the [`NSUnderlineStyleAttributeName`](/documentation/AppKit/NSUnderlineStyleAttributeName) and [`NSStrikethroughStyleAttributeName`](/documentation/AppKit/NSStrikethroughStyleAttributeName) attributes of an attributed string.

## Topics

### Getting the line style

[`NSUnderlineStyleNone`](/documentation/AppKit/NSUnderlineStyle/NSUnderlineStyleNone)

Don’t draw a line.

[`NSUnderlineStyleSingle`](/documentation/AppKit/NSUnderlineStyle/single)

Draw a single line.

[`NSUnderlineStyleThick`](/documentation/AppKit/NSUnderlineStyle/thick)

Draw a thick line.

[`NSUnderlineStyleDouble`](/documentation/AppKit/NSUnderlineStyle/double)

Draw a double line.

[`NSUnderlineStylePatternSolid`](/documentation/AppKit/NSUnderlineStyle/NSUnderlineStylePatternSolid)

Draw a solid line.

[`NSUnderlineStylePatternDot`](/documentation/AppKit/NSUnderlineStyle/patternDot)

Draw a line of dots.

[`NSUnderlineStylePatternDash`](/documentation/AppKit/NSUnderlineStyle/patternDash)

Draw a line of dashes.

[`NSUnderlineStylePatternDashDot`](/documentation/AppKit/NSUnderlineStyle/patternDashDot)

Draw a line of alternating dashes and dots.

[`NSUnderlineStylePatternDashDotDot`](/documentation/AppKit/NSUnderlineStyle/patternDashDotDot)

Draw a line of alternating dashes and two dots.

[`NSUnderlineStyleByWord`](/documentation/AppKit/NSUnderlineStyle/byWord)

Draw the line only beneath or through words, not whitespace.

### Initializers

### Deprecated

[`init(rawValue:)`](/documentation/AppKit/NSUnderlineStyle/init(rawValue:))

[`init(_:)`](/documentation/AppKit/NSUnderlineStyle/init(_:))

Creates a [`NSUnderlineStyle`](/documentation/AppKit/NSUnderlineStyle) from `Text.LineStyle`.

[`NSUnderlinePatternSolid`](/documentation/AppKit/NSUnderlinePatternSolid)

[`NSUnderlinePatternDot`](/documentation/AppKit/NSUnderlinePatternDot)

[`NSUnderlinePatternDash`](/documentation/AppKit/NSUnderlinePatternDash)

[`NSUnderlinePatternDashDot`](/documentation/AppKit/NSUnderlinePatternDashDot)

[`NSUnderlinePatternDashDotDot`](/documentation/AppKit/NSUnderlinePatternDashDotDot)

[`NSUnderlineByWord`](/documentation/AppKit/NSUnderlineByWord)

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

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

---

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)