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

# ConditionalText

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

```
object ConditionalText
```

## Discussion

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

### Example

```json
{
  "components": [
    {
      "role": "text",
      "textStyle": "exampleTextStyleSmall",
      "text": "Apple News Format allows publishers to craft beautiful editorial layouts. Galleries, audio, video, and fun interactions like animation make stories spring to life.",
      "conditional": [
        {
          "textStyle": "exampleTextStyleMedium",
          "conditions": [
            {
              "minViewportWidth": 415
            }
          ]
        },
        {
          "textStyle": "exampleTextStyleLarge",
          "conditions": [
            {
              "minViewportWidth": 769
            }
          ]
        }
      ]
    }
  ],
  "componentTextStyles": {
    "exampleTextStyleSmall": {
      "fontSize": 16
    },
    "exampleTextStyleMedium": {
      "fontSize": 24
    },
    "exampleTextStyleLarge": {
      "fontSize": 48
    }
  }
}
```

## Relationships

### Inherits From

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

---

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)