# About SA5's State Lib

{% hint style="info" %}
**CONCEPT STAGE** - gathering requirements and early design strategy&#x20;
{% endhint %}

In many ways, this is an evolution of the SA5 Track library which already performs many of these tasks in a less structured way.&#x20;

The purpose of SA5's State lib is to;

* Maintain a current "state" representation of the website as a JS session object
* Detect changes, like;
  * Clicking a button
  * Submitting a form
  * Visiting a specific page&#x20;
* Store that state ( in various ways, depending on the use case )
  * Retrieve that state later
* Apply the state
  * Conditional visibility
  * Styling changes like light mode / dark mode&#x20;
  * Submit the data with forms&#x20;


---

# 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://attr.sygnal.com/sa5-state/about.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.
