
Redux
Wire json-render’s StateStore to Redux or Redux Toolkit so AI-generated UI state lives in your existing store slice.
Overview
Redux is an agent skill for the Build phase that integrates json-render with Redux or Redux Toolkit via @json-render/redux and the StateStore adapter.
Install
npx skills add https://github.com/vercel-labs/json-render --skill reduxWhat is this skill?
- Implements json-render StateStore via reduxStateStore for Redux or @reduxjs/toolkit stores
- Documents install paths for redux-only and RTK-recommended setups with @json-render/core and @json-render/react
- Shows slice pattern: replaceUiState reducer, selector for ui slice, dispatch wiring
- StateProvider consumes the adapter so json-render reads/writes flow through Redux
- API entry: reduxStateStore(options) backing the shared StateStore interface
Adoption & trust: 606 installs on skills.sh; 15k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You want json-render to drive UI but your app already owns state in Redux slices and needs one consistent store.
Who is it for?
React builders combining json-render with an existing Redux Toolkit store and a dedicated ui slice.
Skip if: Projects using only Zustand, Jotai, or local React state without Redux—or teams not using json-render at all.
When should I use this skill?
Use when integrating json-render with Redux or Redux Toolkit for state management via @json-render/redux.
What do I get? / Deliverables
You get a wired reduxStateStore, ui slice dispatch pattern, and StateProvider setup so json-render state mutations go through Redux.
- reduxStateStore configuration with selector and dispatch
- ui slice and StateProvider wrapper ready for json-render trees
Recommended Skills
Journey fit
Redux adapter work happens while building the product UI and state layer, before shipping a json-render-powered experience. Integrations fits bridging @json-render packages with Redux/RTK—not greenfield component styling alone.
How it compares
Adapter skill for json-render’s StateStore—not a general Redux migration or global state design course.
Common Questions / FAQ
Who is redux for?
Frontend-focused solo builders and small teams integrating json-render into React apps that already use Redux or Redux Toolkit.
When should I use redux?
During Build integrations when you are implementing @json-render/react and need @json-render/redux to read and write UI state through your Redux store.
Is redux safe to install?
The skill describes standard npm packages and store wiring only; review the Security Audits panel on this page for the catalog listing before you install.
SKILL.md
READMESKILL.md - Redux
# @json-render/redux Redux adapter for json-render's `StateStore` interface. Wire a Redux store (or Redux Toolkit slice) as the state backend for json-render. ## Installation ```bash npm install @json-render/redux @json-render/core @json-render/react redux # or with Redux Toolkit (recommended): npm install @json-render/redux @json-render/core @json-render/react @reduxjs/toolkit ``` ## Usage ```tsx import { configureStore, createSlice } from "@reduxjs/toolkit"; import { reduxStateStore } from "@json-render/redux"; import { StateProvider } from "@json-render/react"; // 1. Define a slice for json-render state const uiSlice = createSlice({ name: "ui", initialState: { count: 0 } as Record<string, unknown>, reducers: { replaceUiState: (_state, action) => action.payload, }, }); // 2. Create the Redux store const reduxStore = configureStore({ reducer: { ui: uiSlice.reducer }, }); // 3. Create the json-render StateStore adapter const store = reduxStateStore({ store: reduxStore, selector: (state) => state.ui, dispatch: (next, s) => s.dispatch(uiSlice.actions.replaceUiState(next)), }); // 4. Use it <StateProvider store={store}> {/* json-render reads/writes go through Redux */} </StateProvider> ``` ## API ### `reduxStateStore(options)` Creates a `StateStore` backed by a Redux store. | Option | Type | Required | Description | |--------|------|----------|-------------| | `store` | `Store` | Yes | The Redux store instance | | `selector` | `(state) => StateModel` | Yes | Select the json-render slice from the Redux state tree. Use `(s) => s` if the entire state is the model. | | `dispatch` | `(nextState, store) => void` | Yes | Dispatch an action that replaces the selected slice with the next state | The `dispatch` callback receives the full next state model and the Redux store.