# 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="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-fc6eef446ff272c85d3ec51a413ba7ffa3fe268e%2F07_04%2003%2032.png?alt=media" 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](https://docs.flatredball.com/gum/gum-tool/gum-elements/states/categories).

## 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="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-a5ec88cb391aeff1c552b64363b6685d92427c2d%2F05_21%2045%2050.png?alt=media" 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.
