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

# State

<figure><img src="/files/HtVyl3WOuvu8RD1Q6lRm" alt=""><figcaption><p>Local State</p></figcaption></figure>

## Creating a Local State Variable

In order to create a **Local State** variable follow the next steps :&#x20;

* Click on the **Add Local State** button
  * Fill the **Field Name** with the name of your variable
  * Choose if your variable should be Persisted or not

    The Application store the value of Persisted variables on the device's storage. If the application is killed and restarted the value is kept.\
    *Example : keeping the user preferences of email address remembered or not, to accelerate the sign-in process.*
  * Choose the **Field Type** of your variable\
    *Optional : You can select **List** and/or **Nullable** to extends your variable's type.*
  * You can add a **Default Value** to your variable, and can choose between a **Static value** or a **Localized** one

<figure><img src="/files/5UArvpOVXlnKrN04m4P8" alt=""><figcaption><p>Creating a Local State variable</p></figcaption></figure>

## Using a value in your application

In order to use a Local State value in your application follow the next steps :&#x20;

* Select a **Widget**
* In the Properties Section, select the *functions* button
* Select the source to **Local State**
* Click on the now red card **From LocalState** to set the **Local State Variable**
* Click on **Save**

<figure><img src="/files/MaiLd93qdwx7zz31hQEz" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
You have set a **Local State Variable** but the preview doesn't change ?

Check the following video to set a **Preview Value**
{% endhint %}

<figure><img src="/files/4hLqnVJcXeJIx0AGia9O" alt=""><figcaption></figcaption></figure>

&#x20;
