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

# ConditionalButton

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

```
object ConditionalButton
```

## Discussion

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

### Example

```json
{
  "components": [
    {
      "role": "link_button",
      "URL": "http://apple.com",
      "text": "Read More",
      "style": {
        "backgroundColor": "#DDD",
        "mask": {
          "type": "corners",
          "radius": 25
        }
      },
      "layout": {
        "padding": 10
      },
      "conditional": [
        {
          "style": "dark-mode-background",
          "textStyle": "dark-mode-text-style",
          "conditions": [
            {
              "preferredColorScheme": "dark"
            }
          ]
        },
        {
          "style": "light-mode-background",
          "textStyle": "light-mode-text-style",
          "conditions": [
            {
              "preferredColorScheme": "light"
            }
          ]
        }
      ]
    }
  ],
  "componentStyles": {
    "dark-mode-background": {
      "backgroundColor": "#5e5e5e",
      "mask": {
        "type": "corners",
        "radius": 25
      }
    },
    "light-mode-background": {
      "backgroundColor": "#DDD",
      "mask": {
        "type": "corners",
        "radius": 25
      }
    }
  },
  "componentTextStyles": {
    "dark-mode-text-style": {
      "textColor": "#FFF"
    },
    "light-mode-text-style": {
      "textColor": "#000"
    }
  }
}
```

## 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)