> For the complete documentation index, see [llms.txt](https://cardstock-studio.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cardstock-studio.gitbook.io/docs/design/templates-design-your-cards/conditionals.md).

# Conditionals

<mark style="color:$success;">**Conditionals**</mark> are logical operations that enable Properties to be modified based on other values. This can be used to provide cascading effects, or to toggle various values based on a Variable or other value.

<figure><picture><source srcset="/files/3pMCGgpGZcczlu87QClC" media="(prefers-color-scheme: dark)"><img src="https://2449056524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK6BdQXak9wiY4BdSf9Rq%2Fuploads%2FpEOnwhDmN5eAzquAhHSg%2FScreenshot%202026-06-03%20at%207.52.16%E2%80%AFPM.png?alt=media&amp;token=b0895726-8842-44d0-8069-3d72f638fe25" alt="" width="375"></picture><figcaption></figcaption></figure>

***

## Adding Conditionals

In the right panel of Book and Template views, click the <picture><source srcset="/files/HkCNmbnH3Q8hoFT4it88" media="(prefers-color-scheme: dark)"><img src="https://2449056524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK6BdQXak9wiY4BdSf9Rq%2Fuploads%2FeikN1scZ5p43KkykAnmk%2FScreenshot%202026-06-03%20at%207.50.20%E2%80%AFPM.png?alt=media&amp;token=3298b698-5ad6-44ef-a335-bd826750386d" alt="" data-size="line"></picture> tab. Then you can add a new rule with the <picture><source srcset="/files/gFBzh7jxMQXOvNS5W247" media="(prefers-color-scheme: dark)"><img src="https://2449056524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK6BdQXak9wiY4BdSf9Rq%2Fuploads%2F8vhUJ3f7VYxjNY20TEZp%2FScreenshot%202026-06-03%20at%207.50.18%E2%80%AFPM.png?alt=media&amp;token=31566d93-3296-4080-abd1-d25d2f968865" alt="" data-size="line"></picture> button.

<figure><picture><source srcset="/files/z6BACrQLLMtun57yWovR" media="(prefers-color-scheme: dark)"><img src="https://2449056524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK6BdQXak9wiY4BdSf9Rq%2Fuploads%2FPS5IPLgFbfVy0gJTK221%2FScreenshot%202026-06-03%20at%207.49.17%E2%80%AFPM.png?alt=media&amp;token=d16eafcd-6e6b-428b-bb96-207e451dfa95" alt="" width="375"></picture><figcaption></figcaption></figure>

You can also add a new Conditional by clicking the <picture><source srcset="/files/2NTJkGoUkhbKTzffYsU3" media="(prefers-color-scheme: dark)"><img src="https://2449056524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK6BdQXak9wiY4BdSf9Rq%2Fuploads%2FNVBRwnzTp9SgsX65YBdh%2FLightning%20Light.png?alt=media&amp;token=e6c63e29-f18e-408b-b27f-1b189dd3391b" alt="" data-size="line"></picture> button next to any Property.

{% hint style="success" %}
Using the <picture><source srcset="/files/2NTJkGoUkhbKTzffYsU3" media="(prefers-color-scheme: dark)"><img src="https://2449056524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK6BdQXak9wiY4BdSf9Rq%2Fuploads%2FNVBRwnzTp9SgsX65YBdh%2FLightning%20Light.png?alt=media&amp;token=e6c63e29-f18e-408b-b27f-1b189dd3391b" alt="" data-size="line"></picture> button will auto populate the *Target* value on a new Conditional. **We suggest you do this, as it is easier and saves time!**
{% endhint %}

***

## Conditional Setup

### Target

The *Target* list will show all the potential targets for a Conditional. If you're setting up a Conditional after clicking <picture><source srcset="/files/2NTJkGoUkhbKTzffYsU3" media="(prefers-color-scheme: dark)"><img src="https://2449056524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK6BdQXak9wiY4BdSf9Rq%2Fuploads%2FNVBRwnzTp9SgsX65YBdh%2FLightning%20Light.png?alt=media&amp;token=e6c63e29-f18e-408b-b27f-1b189dd3391b" alt="" data-size="line"></picture> then the *Target* is auto populated, and you can't adjust it.

### Condition

Toggle off *Always Apply* to view the logical operations. Some of these values will differ depending on the *Target*.

#### When...

The *When* value is the thing that determines "when" the Conditional is triggered. You can choose from specific Layers, or Variables.

Then, choose what you are looking to compare. In the example below, the human readable phrase is "When *Player Count* (a number) is *Greater Than* a fixed value of *3*...."

<figure><picture><source srcset="/files/lojj5V3oy68xUlcTxgN0" media="(prefers-color-scheme: dark)"><img src="https://2449056524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK6BdQXak9wiY4BdSf9Rq%2Fuploads%2FlPzfGRwM3HnmICCWRsbl%2FScreenshot%202026-06-03%20at%207.57.47%E2%80%AFPM.png?alt=media&amp;token=053a900d-f27c-46d2-96fb-a12ef0f362af" alt="" width="375"></picture><figcaption></figcaption></figure>

#### Is...

This is the comparison type. Greater than, equal to, not equal to, etc.

#### To...

This is the value we are comparing against. You can choose *Fixed Value*, and set that value, or choose *From Variable* or *From Another Element*.

***From Variable***

This will allow you to choose a Variable — that dynamic value will then be used to compare against, allowing for different Cards in your Deck to have different outcomes.

***From Another Element***

This will allow you to choose another Layer, and then a value from that Layer. This is useful to perform cascading effects.

### Action Value

*Action Value* is what happens when the Conditional returns a positive result. This should be different than the standard setting for the Property.

<figure><picture><source srcset="/files/VuSqdMlV847ILqO3Y1gO" media="(prefers-color-scheme: dark)"><img src="https://2449056524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK6BdQXak9wiY4BdSf9Rq%2Fuploads%2FjD6kRl4jqDv1elzEa4OJ%2FScreenshot%202026-06-03%20at%208.02.12%E2%80%AFPM.png?alt=media&amp;token=cfee99e7-7a85-471c-80f4-fb469b9243e9" alt="" width="375"></picture><figcaption></figcaption></figure>

In this example, we are setting an *Image* to "TrollsTitle.png" when the Conditional returns true.

***

## Modifying Conditionals

You can modify a Conditional by clicking the highlighted <picture><source srcset="/files/2NTJkGoUkhbKTzffYsU3" media="(prefers-color-scheme: dark)"><img src="https://2449056524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK6BdQXak9wiY4BdSf9Rq%2Fuploads%2FNVBRwnzTp9SgsX65YBdh%2FLightning%20Light.png?alt=media&amp;token=e6c63e29-f18e-408b-b27f-1b189dd3391b" alt="" data-size="line"></picture> button — this will open the Conditional assigned to the Property.

Or, click the <picture><source srcset="/files/HkCNmbnH3Q8hoFT4it88" media="(prefers-color-scheme: dark)"><img src="https://2449056524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK6BdQXak9wiY4BdSf9Rq%2Fuploads%2FeikN1scZ5p43KkykAnmk%2FScreenshot%202026-06-03%20at%207.50.20%E2%80%AFPM.png?alt=media&amp;token=3298b698-5ad6-44ef-a335-bd826750386d" alt="" data-size="line"></picture> tab to view and edit any Conditional.

***

## Deleting Conditionals

While modifying, click <picture><source srcset="/files/rkpHh0TPVmnURdXKxjyh" media="(prefers-color-scheme: dark)"><img src="https://2449056524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK6BdQXak9wiY4BdSf9Rq%2Fuploads%2FurwXFmEqCaV8UaykbHnr%2FScreenshot%202026-06-03%20at%208.02.17%E2%80%AFPM.png?alt=media&amp;token=01f01139-9c35-4f27-8bda-c0b23ef43d43" alt="" data-size="line"></picture> to delete a Conditional.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cardstock-studio.gitbook.io/docs/design/templates-design-your-cards/conditionals.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
