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

# ConditionalComponentStyle

The object for defining conditional properties for a component style, and when the conditional properties are in effect.

```
object ConditionalComponentStyle
```

## Discussion

Use the `ConditionalComponentStyle` object to define an array of conditional component style properties and the conditions under which to apply them. When a condition is met, the value of a property in `ConditionalComponentStyle` overrides the value of the same property if you define it in the parent `ComponentStyle` object. See [`ComponentStyle`](/documentation/AppleNewsFormat/ComponentStyle).

### Example

```json
{
  "components": [
    {
      "role": "body",
      "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
      "style": "exampleStyle"
    }
  ],
  "componentStyles": {
    "exampleStyle": {
      "backgroundColor": "#e3e3e3",
      "conditional": [
        {
          "backgroundColor": "goldenrod",
          "conditions": [
            {
              "verticalSizeClass": "compact"
            }
          ]
        }
      ]
    }
  }
}
```

## Relationships

### Inherits From

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

---

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)