<!--
{
  "availability" : [
    "Apple News Format: 1.7.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppleNews",
  "identifier" : "/documentation/AppleNewsFormat/TextStyle",
  "metadataVersion" : "0.1.0",
  "role" : "Object",
  "symbol" : {
    "kind" : "Object",
    "modules" : [
      "Apple News Format"
    ],
    "preciseIdentifier" : "data:news_format:TextStyle"
  },
  "title" : "TextStyle"
}
-->

# TextStyle

The object for defining the text style, such as font family, size, and color, that you can apply to ranges of text.

```
object TextStyle
```

## Discussion

A `TextStyle` object defines a style that you can apply to ranges of text. Include a property, with a name that you define and a `TextStyle` object for the value, in the [`ArticleDocument.textStyles`](/documentation/AppleNewsFormat/ArticleDocument/textStyles-data.dictionary) object. Then,  you can use that property’s name string together with HTML, Markdown, or [`InlineTextStyle`](/documentation/AppleNewsFormat/InlineTextStyle) to apply the style to a range of text.

If you’re using Markdown syntax to style your text, see the <doc://com.apple.applenews/documentation/AppleNews/using-markdown-with-apple-news-format#Inline-Text-Style> section in <doc://com.apple.applenews/documentation/AppleNews/using-markdown-with-apple-news-format>. If you’re using HTML, see <doc://com.apple.applenews/documentation/AppleNews/using-html-with-apple-news-format>.

You can use this object in [`ArticleDocument.textStyles`](/documentation/AppleNewsFormat/ArticleDocument/textStyles-data.dictionary).

### Example

```json
{
  "textStyles": {
    "default-tag-abbr": {
      "textColor": "#34af15"
    }
  },
  "components": [
    {
      "role": "body",
      "format": "html",
      "text": "<p>The <abbr>WWF</abbr> is an international wildlife fund.</p>"
    }
  ]
}
```

## See Also

  <doc://com.apple.applenews/documentation/AppleNews/adding-color-to-text-ranges>

## Relationships

### Inherited By

[`ConditionalComponentTextStyle`](/documentation/AppleNewsFormat/ConditionalComponentTextStyle)

[`ConditionalTextStyle`](/documentation/AppleNewsFormat/ConditionalTextStyle)

[`ComponentTextStyle`](/documentation/AppleNewsFormat/ComponentTextStyle)

---

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)