# States

## Introduction

States are collection of variables which can be used to represent a component or screen configuration. States can be used for a variety of situations including:

* Defining the appearance of a UI element such as Enabled, Disabled, Highlighted, and Pushed
* Defining positions for interpolation and animation such as OffScreen and OnScreen
* Defining start/end or empty/full states for interpolation such as AmmoFull and AmmoEmpty
* Defining appearance in response to game-specific status such as NotJoined and PlayerJoined
* Defining layout for responsive designs, such as MobileLayout, TabletLayout, DesktopLayout, and UltraWideLayout

Every element automatically includes a `Default` state which cannot be removed. This state is automatically selected and any changes made to a component happen on the Default state unless a different state is selected.

<figure><img src="/files/Bh98esiQptjceI2j8uCE" alt=""><figcaption><p>Default state in a component named DefaultComponent</p></figcaption></figure>

Additional states can be created in Screens, Components, and Standard elements. These states must be created in Categories. For more information, see the [Categories page](/gum/gum-tool/gum-elements/states/categories.md).

## Adding States to a Category

To add states to a category:

1. Right-click on the desired category
2. Select Add State

   <figure><img src="/files/IxYt4pXXAMIpqHO1YMZd" alt=""><figcaption><p>Right click Add State item</p></figcaption></figure>
3. Enter a name for the new state

Once the state has been created it can be selected and variables can be changed to add them to the new state.


---

# Agent Instructions: 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:

```
GET https://docs.flatredball.com/gum/gum-tool/gum-elements/states.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
