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

# State actions

Jigx provides three levels of *state management* that allow you to store, update, and share data dynamically within your app.\
Each state type serves a different purpose, from app-wide variables to screen(jig)-specific and component-level data, enabling flexible logic and responsive UI behavior.

## **Types of State**

<table><thead><tr><th width="137.15234375">State Type</th><th width="146.31640625">Scope</th><th width="135.40234375">Defined In</th><th>Accessed Using</th><th>Typical Use Case</th></tr></thead><tbody><tr><td><a href="/pages/ovFfDFXtCmL6jG8T7yaB">Solution State</a></td><td>Global (shared across all jigs)</td><td><code>index.jigx</code></td><td><code>@ctx.solution.state</code></td><td>Store user roles, preferences, or data shared across multiple screens.</td></tr><tr><td><a href="/pages/cbGSi3I9sEUmyYisT0te">Jig State</a></td><td>Screen-specific</td><td>Inside a jig file (e.g., <code>jig-a.jigx</code>)</td><td><code>@ctx.jig-state</code></td><td>Manage temporary or screen-level logic, such as workflow steps or filters.</td></tr><tr><td><a href="/pages/3N8lWgm2T7Hn0gqt4qBp">State (Component State)</a></td><td>Component-specific</td><td>Within a component or control</td><td><code>@ctx.component.state</code><br><code>@ctx.current.state</code></td><td>Track component interactions, such as toggles, field input, or selected list items.</td></tr></tbody></table>

## **Best Practices**

* Use **Solution State** for global variables shared across multiple screens.
* Use **Jig State** for logic or UI control within a single screen.
* Use **Component State** for localized interactions within a specific component.
* Always reset state where appropriate (e.g., on logout, refresh, or workflow completion) to ensure consistent behavior.


---

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

```
GET https://docs.jigx.com/examples/readme/actions/state-actions.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.
