> For the complete documentation index, see [llms.txt](https://docs.flatredball.com/gum/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flatredball.com/gum/gum-tool/variables.md).

# Variables

## Introduction

The Variables tab displays the variables for the currently-selected element, instance, or behavior. The variables tab displays the effective value of all variables for the selected object and provides controls for changing these variables.

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-28703b5cf8adcd004da463c97d82d5f91d93f794%2FVariablesTab.png?alt=media" alt=""><figcaption><p>Variables for the ExitButton instance</p></figcaption></figure>

## Filtering Variables

An element can have more variables than fit on screen, so a filter box sits above the variable list. Type in it and the tab shows only the variables whose name contains what you typed. Matching ignores capitalization, so typing `vis` finds `Visible`.

Matching variables stay inside their own categories, which means a filter also shows you where a variable lives. Categories holding no matches hide while you are filtering, and clearing the filter restores every category, including which ones you had expanded.

Press `Ctrl+E` from anywhere in Gum to bring the **Variables** tab forward and put the cursor in the filter box. Press `Escape` to clear the filter and move focus back to the variable list, or click the **X** button at the right of the box.

## Default and Explicitly Set Values

A variable which is explicitly set at the current selection level has a small box icon next to its label. A variable without the icon is not set, so it inherits its value from the next level down.

Standard elements explicitly set their values on their Default state, so every variable shows the icon. The following image shows the Rectangle standard element.

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-7cc6f127821e4ba9d27ce33acf5a47235083c8ca%2F14_09_20_01.png?alt=media" alt=""><figcaption><p>All values explicitly set on a Rectangle standard element</p></figcaption></figure>

By contrast, if a Rectangle is dropped into a Screen or Component, this creates an instance. Most of its variables on the instance are not explicitly set, so they have no icon. For example, in the following image `X` is the only Position variable that is set on the instance. `Y` and the unit variables inherit their values from the Rectangle standard element.

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-61f3efbd677c25970f511d09975475cf6ff10e9e%2F14_09_20_02.png?alt=media" alt=""><figcaption><p>Only X is set in Position, so only X has the icon there</p></figcaption></figure>

If a variable is set, then its value is updated and the icon appears. Variables can be set by typing in values, clicking on icons, dragging over the labels, or changing the value in the editor tab.

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-8159aa6f541c8c4798cb07921d8a7e70a4e4d0d0%2F14_09_20_03.png?alt=media" alt=""><figcaption><p>After setting Y, the icon appears next to Y</p></figcaption></figure>

## Setting Variables to Default

A changed variable can be restored to default.

Any change can be undone with the CTRL+Z key combination if the variable was previously set to its default value. The undo history can be viewed in the History tab which updates as changes are made or as undo's are applied.

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-02aa395112d5b5e8050de77d8805210de6e33691%2F15_04%2027%2013.gif?alt=media" alt=""><figcaption><p>If a variable was previously its default value, an undo restores the default value</p></figcaption></figure>

Variables can be set to default by right-clicking on the variable in the Variables tab and selecting the **Make Default** option.

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-409cfba397287eefe41105178cdd3f36594ad934%2F15_04%2029%2004.gif?alt=media" alt=""><figcaption><p>Make Default right click option restores a variable to its default value</p></figcaption></figure>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flatredball.com/gum/gum-tool/variables.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
