> 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/variables.md).

# Variables

<mark style="color:$success;">**Variables**</mark> are values that are intended to be unique per Card in your Deck. Any value that may change should be turned into a variable and then <mark style="color:$success;">**Linked**</mark> to the properties on your Components.

<figure><picture><source srcset="/files/LR2U8QMQrCnGXgy7XF8W" media="(prefers-color-scheme: dark)"><img src="https://2449056524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK6BdQXak9wiY4BdSf9Rq%2Fuploads%2FXXfLRSyONx4mS6NKCC7F%2FScreenshot%202026-06-03%20at%206.54.01%E2%80%AFPM.png?alt=media&amp;token=6835494c-8ff5-487f-bda8-09e34f359782" alt="" width="372"></picture><figcaption></figcaption></figure>

{% hint style="info" %}
[Global Values](/docs/design/global-values.md) are very similar to **Variables**, but are scoped to the entire project. Whenever you plan on using the same thing over and over, set it as a Global Value, so if you change it later, it will update in all places it is being used.

This is useful for changing images, so that you only have to update the image in one place.
{% endhint %}

***

## Adding Variables

**Variables** live in the left side panel. Click the <picture><source srcset="/files/WwsHmFzAVrF1m8HDwtc5" media="(prefers-color-scheme: dark)"><img src="https://2449056524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK6BdQXak9wiY4BdSf9Rq%2Fuploads%2FzxKXy7K3tGPdUjpecgTE%2FScreenshot%202026-06-03%20at%206.54.40%E2%80%AFPM.png?alt=media&amp;token=90707ba7-6d99-40dd-a185-c82b9f5faa4a" alt="" data-size="line"></picture> tab to view. Then click <picture><source srcset="/files/ykUtNZNDXP8nHJGq3zTO" media="(prefers-color-scheme: dark)"><img src="https://2449056524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK6BdQXak9wiY4BdSf9Rq%2Fuploads%2FO8MnlQke0YFq5BComZdX%2FScreenshot%202026-06-03%20at%206.59.44%E2%80%AFPM.png?alt=media&amp;token=13b86fc4-218e-4169-848a-854cbc8556fa" alt="" data-size="line"></picture> to create a new Variable. It will show up at the bottom of the list.

***

## Modifying Variables

You can change the *Type* of the Variable by clicking the type icon in the top left. Then, you can set the *Value* of the Variable, depending on the type.

<figure><picture><source srcset="/files/ahCvRInOQsYkudmBeQTy" media="(prefers-color-scheme: dark)"><img src="https://2449056524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK6BdQXak9wiY4BdSf9Rq%2Fuploads%2FlJw3N8HHHtFazFJm3Mrt%2FScreen%20Recording%202026-06-03%20at%207.09.21%E2%80%AFPM.gif?alt=media&amp;token=e88e081c-ac75-4b63-bae0-d926776edf6e" alt=""></picture><figcaption></figcaption></figure>

For "In Line Image" Variables, click the "Details" to see additional options you can set.

***

## Variable Description

<figure><picture><source srcset="/files/SRlGhPUfAd6B0gAPxvCD" media="(prefers-color-scheme: dark)"><img src="https://2449056524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK6BdQXak9wiY4BdSf9Rq%2Fuploads%2F2WZYmYuqvzSjptYqN1AM%2FScreenshot%202026-07-01%20at%209.46.21%E2%80%AFPM.png?alt=media&amp;token=d1e08c24-14cc-4fe4-8cda-bda76693b305" alt="" width="362"></picture><figcaption></figcaption></figure>

If the Variable only handles a cosmetic value, such as a background image or color, and does not have any impact on the gameplay logic, keep the value type as "Cosmetic".

Otherwise, select "Gameplay", and enter a description of what the variable represents in the game logic.

This is used by the AI agents when helping you create rules, check for game logic issues, and play testing.

{% hint style="success" %}
When describing variables, be fairly descriptive. The AI benefits from clear, detailed langugage, saving time and effort later.

For example, if a variable may be blank, you may wish to include in the description: "This may be blank, in which case it has no logic effect." This helps the AI understand there is no bug or problem, that the blank value is intentional.
{% endhint %}

***

## Linking Variables

Click the <picture><source srcset="/files/wEtgWAtq6PckOI0iekR1" media="(prefers-color-scheme: dark)"><img src="https://2449056524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK6BdQXak9wiY4BdSf9Rq%2Fuploads%2FoWDjKeV32mdOx3gDiY7X%2FLink%20Light.png?alt=media&amp;token=16a0e627-83bf-4731-8558-457be14e7abd" alt="" data-size="line"></picture> icon next to any Property in a Component and then select a Variable or Global Value to link it to. While linked, it will utilize the Variable value or Global Value.

Click the icon again to unlink.

***

## Deleting Variables

Right-click any Variable and select "Delete" to delete the variable. Any Property that is linked will revert to the value set in the Component.

***

## Using Global Values in a Variable

**This is a powerful feature.**&#x20;

Once you define a Variable in your Template, you can assign a [**Global Value**](/docs/design/global-values.md) to it in your Deck. This means that you can use variable global values, bringing in the ease of updating Global Values while still using Variables.

To do this, create the Variable as normal. Then, in the [Decks](/docs/design/decks.md) view, edit a cell value to be `<GlobalValueName>`. Of course use the correct name of the Global Value. The Card will resolve the Global Value and display it.&#x20;

***

## Modifying Global Values in Book / Template Views

You can toggle between Local Variables and Global Values using the <picture><source srcset="/files/S0qySxQBgCkRYhQJpbFf" media="(prefers-color-scheme: dark)"><img src="https://2449056524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK6BdQXak9wiY4BdSf9Rq%2Fuploads%2FgP82P5bINfbwA5jJyiN8%2FScreenshot%202026-06-03%20at%206.59.56%E2%80%AFPM.png?alt=media&amp;token=943b97d6-d2b3-479a-b589-f7ed5082674f" alt="" data-size="line"></picture> toggle. Here you can add and edit Global Values, or you can do so on the [Global Values](/docs/design/global-values.md) view.

<figure><picture><source srcset="/files/V48DYM78DgaeizVudhGB" media="(prefers-color-scheme: dark)"><img src="https://2449056524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK6BdQXak9wiY4BdSf9Rq%2Fuploads%2FmcN4x0YVghOgzZROGlz6%2FScreenshot%202026-06-03%20at%207.07.11%E2%80%AFPM.png?alt=media&amp;token=ad4ce85b-bc68-4718-b195-a09471c79b30" alt="" width="367"></picture><figcaption></figcaption></figure>

{% hint style="warning" %}
Changes made to Global Values in the Book / Template view will affect all Properties using the Global Value anywhere in your project.
{% endhint %}


---

# 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/variables.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.
