<!--
{
  "availability" : [
    "macOS: 15.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextHighlightStyleAttributeName",
  "metadataVersion" : "0.1.0",
  "role" : "Global Variable",
  "symbol" : {
    "kind" : "Global Variable",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:@NSTextHighlightStyleAttributeName"
  },
  "title" : "NSTextHighlightStyleAttributeName"
}
-->

# NSTextHighlightStyleAttributeName

An attribute that adds a highlight color to the text to emphasize it.

```
extern NSAttributedStringKey const NSTextHighlightStyleAttributeName;
```

## Discussion

The value of this attribute is an [`NSTextHighlightStyle`](/documentation/AppKit/NSTextHighlightStyle) structure. The default value of this attribute is `nil`, which does not add a highlight to the text.

A highlight adds a background color behind the text, and adjusts the color of the text itself to contrast appropriately. The [`NSTextHighlightStyleDefault`](/documentation/AppKit/NSTextHighlightStyleDefault) highlight style applies the system highlight color to your text. To apply a different color, add the [`NSTextHighlightColorSchemeAttributeName`](/documentation/AppKit/NSTextHighlightColorSchemeAttributeName) attribute to your text in addition to this one. Use the [`NSTextHighlightColorSchemeAttributeName`](/documentation/AppKit/NSTextHighlightColorSchemeAttributeName) key to specify which highlight color you want.

---

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)