---
title: Condition
framework: applenewsformat
role: symbol
role_heading: Object
path: applenewsformat/condition
---

# Condition

The object for defining a condition that, when met, causes conditional properties to go into effect.

## Declaration

```data
object Condition
```

## Properties

app: The application in which a person views the Apple News article. Valid values: any: The person is viewing the Apple News article in either the Apple News app or in the Stocks app. news: The person is viewing the Apple News article in the Apple News app. stocks: The person is viewing the Apple News article in the Stocks app. following: A Boolean or a string value to indicate whether the person viewing the article is following the channel that published the article. When you set the value to true or false, the system infers the channel ID from the article. When you set the value to a channel ID string, the conditional validates to true when the person is following that channel. horizontalSizeClass: A string describing the width at which Apple News displays the article. The value indicates whether iOS considers the article width constrained (compact) or expansive (regular). When Apple News displays the article at the specified size class, the conditional properties are in effect. The horizontal size class is always regular in macOS. maxColumns: The maximum number of columns in which Apple News displays the article. When a person views the article with the specified number of columns or fewer, the conditional properties are in effect. For more information about the column system, see Planning the Layout for Your Article. maxContentSizeCategory: A string indicating a dynamic type size at which Apple News displays the article. When the article is displayed at the specified size or smaller, the conditional properties are in effect. The default content size category in iOS and macOS is L. maxSpecVersion: An Apple News Format version that an Apple News client can use to display an article. When the Apple News Format version is equal to or less than the specified value, the conditional properties are in effect. maxViewportAspectRatio: A number indicating a width divided by a height. When the aspect ratio of the person’s viewport is the specified value or smaller, the conditional properties are in effect. maxViewportWidth: A number indicating width in points. When the width of the person’s viewport is the specified value or smaller, the conditional properties are in effect. minColumns: The minimum number of columns in which Apple News displays the article. When a person views the article with the specified number of columns or more, the conditional properties are in effect. For more information about the column system, see Planning the Layout for Your Article. minContentSizeCategory: A string indicating a dynamic type size at which Apple News displays the text in the article. When Apple News displays the article at the specified dynamic type size or greater, the conditional properties are in effect. The default content size category in iOS and macOS is L. minSpecVersion: An Apple News Format version that can be used by an Apple News client that is displaying an article. When the Apple News Format version is equal to or greater than the specified value, the conditional properties are in effect. minViewportAspectRatio: A number indicating a width divided by a height. When the aspect ratio of the person’s viewport is the specified value or greater, the conditional properties are in effect. minViewportWidth: A number indicating the width in points. When the width of the person’s viewport is the specified value or greater, the conditional properties are in effect. platform: A platform on which a person can view an article. When the person views the article on the specified platform, the conditional properties are in effect. preferredColorScheme: A string describing the person’s preferred color theme for the system. Valid values: any. The person has no preference. light. The person hasn’t enabled Dark Mode. dark. The person has enabled Dark Mode. subscriptionStatus: The type of subscription the person has. When the subscription is of the specified type, the conditional properties are in effect. verticalSizeClass: A string describing the height at which Apple News displays the article. The value indicates whether iOS considers the article width  constrained (compact) or expansive (regular). When Apple News displays the article at the specified size class, the conditional properties are in effect. The vertical size class is always regular in macOS. territory: The territory of the person. When the value is specified, the conditional properties are in effect. viewLocation: The context of the article. When the context is of the specified type, the conditional properties are in effect.

## Mentioned in

Apple News Format Release Notes Giving the Article a Dark Color Scheme Supporting Dark Mode for Your Article

## Discussion

Discussion Use the Condition object to define the condition under which the associated properties are applied. You can use this object in ConditionalComponent, ConditionalContainer, ConditionalSection, ConditionalText, ConditionalComponentLayout, ConditionalComponentStyle, ConditionalComponentTextStyle, ConditionalTextStyle, ConditionalDocumentStyle, ConditionalDivider, and ConditionalAutoPlacement. Example {   "components": [     {       "role": "photo",       "URL": "bundle://summer.jpg",       "layout": "exampleLayout",       "caption": "Thanks to the record drought, mountain lions have begun to descend from the peaks.",       "hidden": false,       "conditional": {         "hidden": true,         "conditions": {           "maxViewportWidth": 320         }       }     }   ],   "componentLayouts": {     "exampleLayout": {       "ignoreDocumentMargin": true,       "conditional": [         {           "ignoreDocumentMargin": false,           "conditions": [             {               "minViewportWidth": 768             }           ]         }       ]     }   } }

## See Also

### Conditional Design Elements

- [ConditionalComponent](applenewsformat/conditionalcomponent.md)
- [ConditionalComponentLayout](applenewsformat/conditionalcomponentlayout.md)
- [ConditionalAutoPlacement](applenewsformat/conditionalautoplacement.md)
- [ConditionalSection](applenewsformat/conditionalsection.md)
- [ConditionalDocumentStyle](applenewsformat/conditionaldocumentstyle.md)
- [ConditionalText](applenewsformat/conditionaltext.md)
- [ConditionalTextStyle](applenewsformat/conditionaltextstyle.md)
- [ConditionalComponentTextStyle](applenewsformat/conditionalcomponenttextstyle.md)
- [ConditionalComponentStyle](applenewsformat/conditionalcomponentstyle.md)
- [ConditionalContainer](applenewsformat/conditionalcontainer.md)
- [ConditionalDivider](applenewsformat/conditionaldivider.md)
- [ConditionalButton](applenewsformat/conditionalbutton.md)
