All skills

The Generative UI framework

14,483 774 Updated last week First seen 3 months agoactive
npx -y skilld add gh:vercel-labs/json-render -s xstate

No curator note yet. Be the first to add yours — one line on why you reach for this skill.

@json-render/xstate

XState Store adapter for json-render's StateStore interface. Wire an @xstate/store atom as the state backend for json-render.

Installation

npm install @json-render/xstate @json-render/core @json-render/react @xstate/store

Requires @xstate/store v3+.

Usage

import { createAtom } from "@xstate/store";
import { xstateStoreStateStore } from "@json-render/xstate";
import { StateProvider } from "@json-render/react";

// 1. Create an atom
const uiAtom = createAtom({ count: 0 });

// 2. Create the json-render StateStore adapter
const store = xstateStoreStateStore({ atom: uiAtom });

// 3. Use it
<StateProvider store={store}>
  {/* json-render reads/writes go through @xstate/store */}
</StateProvider>

API

xstateStoreStateStore(options)

Creates a StateStore backed by an @xstate/store atom.

Option Type Required Description
atom Atom<StateModel> Yes An @xstate/store atom (from createAtom) holding the json-render state model

Source: SKILL.md on GitHub

No curators have added this skill yet. Be the first to include it in a collection.