
Jotai
Wire json-render UI state through a Jotai atom so agent-generated layouts stay in sync with the rest of a React app.
Overview
jotai is an agent skill for the Build phase that wires json-render's StateStore to a Jotai atom (and optional shared store) for React UIs.
Install
npx skills add https://github.com/vercel-labs/json-render --skill jotaiWhat is this skill?
- Implements json-render StateStore via jotaiStateStore({ atom, optional store })
- Documents npm install for @json-render/jotai, core, react, and jotai
- Supports a dedicated uiAtom plus optional shared createStore() for one Provider tree
- Shows StateProvider wrapping children so reads/writes route through Jotai
Adoption & trust: 597 installs on skills.sh; 15k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You are using json-render in React but need UI state to live in Jotai atoms without breaking StateProvider contracts.
Who is it for?
Solo builders already on json-render + React who standardize on Jotai for client state.
Skip if: Teams not using json-render, non-React apps, or greenfield state-library selection with no json-render in the stack.
When should I use this skill?
Integrating json-render with Jotai for state management via @json-render/jotai.
What do I get? / Deliverables
After following the skill, your agent produces a StateProvider setup where json-render read/write paths go through the configured Jotai atom and optional shared store.
- Jotai atom + jotaiStateStore adapter wiring
- StateProvider tree snippet with optional shared Jotai store
Recommended Skills
Journey fit
Canonical shelf is Build because the skill only applies while implementing json-render consumers in a React frontend. Frontend is the right subphase: StateProvider, atoms, and shared Jotai stores are UI state concerns, not backend APIs.
How it compares
Use as a narrow adapter recipe—not a general React state-management tutorial or Redux/Zustand comparison.
Common Questions / FAQ
Who is jotai for?
Indie and solo developers building json-render-based React interfaces who want Jotai as the state layer behind StateProvider.
When should I use jotai?
During Build (frontend) when integrating @json-render/react with Jotai, especially if you already use a custom Jotai Provider store.
Is jotai safe to install?
The skill is documentation-only for npm packages you choose to install; review the Security Audits panel on this Prism page before adding dependencies to your repo.
SKILL.md
READMESKILL.md - Jotai
# @json-render/jotai Jotai adapter for json-render's `StateStore` interface. Wire a Jotai atom as the state backend for json-render. ## Installation ```bash npm install @json-render/jotai @json-render/core @json-render/react jotai ``` ## Usage ```tsx import { atom } from "jotai"; import { jotaiStateStore } from "@json-render/jotai"; import { StateProvider } from "@json-render/react"; // 1. Create an atom that holds the json-render state const uiAtom = atom<Record<string, unknown>>({ count: 0 }); // 2. Create the json-render StateStore adapter const store = jotaiStateStore({ atom: uiAtom }); // 3. Use it <StateProvider store={store}> {/* json-render reads/writes go through Jotai */} </StateProvider> ``` ### With a Shared Jotai Store When your app already uses a Jotai `<Provider>` with a custom store, pass it so both json-render and your components share the same state: ```tsx import { atom, createStore } from "jotai"; import { Provider as JotaiProvider } from "jotai/react"; import { jotaiStateStore } from "@json-render/jotai"; import { StateProvider } from "@json-render/react"; const jStore = createStore(); const uiAtom = atom<Record<string, unknown>>({ count: 0 }); const store = jotaiStateStore({ atom: uiAtom, store: jStore }); <JotaiProvider store={jStore}> <StateProvider store={store}> {/* Both json-render and useAtom() see the same state */} </StateProvider> </JotaiProvider> ``` ## API ### `jotaiStateStore(options)` Creates a `StateStore` backed by a Jotai atom. | Option | Type | Required | Description | |--------|------|----------|-------------| | `atom` | `WritableAtom<StateModel, [StateModel], void>` | Yes | A writable atom holding the state model | | `store` | Jotai `Store` | No | The Jotai store instance. Defaults to a new store. Pass your own to share state with `<Provider>`. |