> ## Documentation Index
> Fetch the complete documentation index at: https://prefab.prefect.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# STATE

> Proxy for accessing state keys as reactive references.

`STATE` gives you reactive references to state keys through attribute access. `STATE.count` is equivalent to `Rx("count")` — it creates an `Rx` reference without needing to declare one separately.

```python theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
from prefab_ui.rx import STATE

STATE.count       # → {{ count }}
STATE.user.name   # → {{ user.name }}
```

## Usage

`STATE` is useful for referencing keys created dynamically by form controls or actions without needing a separate `Rx` declaration:

```python theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
from prefab_ui.rx import STATE
from prefab_ui.components import Input, Text

Input(name="query", placeholder="Search...")
Text(f"You typed: {STATE.query}")
```

## Dot Paths

Attribute access chains naturally. Each `.` adds a path segment to the expression:

```python theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
from prefab_ui.rx import STATE

STATE.user.address.city    # → {{ user.address.city }}
STATE.todos.length()       # → {{ todos | length }}
```

## Import

```python theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
from prefab_ui.rx import STATE
```

Use `STATE` anywhere you need a quick reactive reference to a state key without creating a separate `Rx`.
