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

# ComponentStyle

The object for setting style properties for components, including background color and fill, borders, and table styles.

```
object ComponentStyle
```

## Discussion

Use the `ComponentStyle` object to define the visual appearance of a component, including its background color, fill, opacity, borders, and table style.

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

### Example

```json
{
  "components": [
    {
      "role": "container",
      "style": "exampleComponentStyle",
      "components": [
        {
          "role": "title",
          "text": "Drought"
        }
      ]
    }
  ],
  "componentStyles": {
    "exampleComponentStyle": {
      "backgroundColor": "#FFFFFF",
      "opacity": 1,
      "border": {
        "all": {
          "width": 1,
          "color": "#333"
        },
        "left": false,
        "right": false
      }
    }
  }
}
```

## See Also

  <doc://com.apple.applenews/documentation/AppleNews/giving-the-article-a-dark-color-scheme>

## Relationships

### Inherited By

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

---

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)