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

# ConditionalComponent

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

```
object ConditionalComponent
```

## Discussion

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

### Example

```json
{
  "components": [
    {
      "role": "title",
      "text": "Article Title",
      "style": "red-background",
      "textStyle": {
        "textAlignment": "center"
      },
      "layout": "short-header",
      "conditional": [
        {
          "style": "blue-background",
          "textStyle": {
            "textAlignment": "left"
          },
          "layout": "tall-header",
          "conditions": [
            {
              "minViewportWidth": 415
            }
          ]
        }
      ]
    }
  ],
  "componentStyles": {
    "red-background": {
      "backgroundColor": "red"
    },
    "blue-background": {
      "backgroundColor": "blue"
    }
  },
  "componentLayouts": {
    "short-header": {
      "minimumHeight": 100
    },
    "tall-header": {
      "minimumHeight": 200
    }
  }
}
```

## Relationships

### Inherited By

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

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

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

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

---

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)