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

# ComponentTextStyle

The object for defining the style for a text component, including spacing, alignment, and drop caps.

```
object ComponentTextStyle
```

## Discussion

Use a `ComponentTextStyle` object to define the text style for an entire text component (such as `body` or `heading`). A `ComponentTextStyle` object can have the same properties as a `TextStyle` object, as well as some additional properties such as a drop cap and text alignment.

To use a `ComponentTextStyle` once, include a `ComponentTextStyle` object as the value of the individual component’s `style` property.

To define a style that multiple components can use:

1. Include a property, with a name that you define and a `ComponentTextStyle` object value, in the [`ArticleDocument.componentTextStyles`](/documentation/AppleNewsFormat/ArticleDocument/componentTextStyles-data.dictionary) object.
2. Use the name you created as the value of the individual component’s `textStyle` property.

To create a default text style for the article, define a component text style in [`ArticleDocument.componentTextStyles`](/documentation/AppleNewsFormat/ArticleDocument/componentTextStyles-data.dictionary) object and use the key `default`.

To create a default component text style for a `role`, `d`efine a component text style in [`ArticleDocument.componentTextStyles`](/documentation/AppleNewsFormat/ArticleDocument/componentTextStyles-data.dictionary) and use the key `default-<role>`. For example, if you define a component text style with the key `default-title`, all components with a `role` of `title` use that style, unless you override it.

For more information about properties, objects, keys, and values, see <doc://com.apple.applenews/documentation/AppleNews/json-concepts-and-article-structure>. For more about components and roles, see <doc://com.apple.applenews/documentation/AppleNews/components>.

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

### Example

```json
{
  "componentTextStyles": {
    "exampleStyle": {
      "fontName": "HelveticaNeue",
      "fontSize": 20,
      "dropCapStyle": {
        "numberOfLines": 3,
        "numberOfRaisedLines": 2,
        "numberOfCharacters": 1,
        "fontName": "HelveticaNeue",
        "textColor": "#FFF",
        "backgroundColor": "#000",
        "padding": 5
      }
    }
  },
  "components": [
    {
      "role": "body",
      "text": "This is body text",
      "textStyle": "exampleStyle"
    }
  ]
}
```

## See Also

  <doc://com.apple.applenews/documentation/AppleNews/creating-your-first-article>



---

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)