The SolidJS rendering layer observes the actor atoms and renders the UI components through @xmachines/json-render-solid. SolidJS reactivity only triggers the re-render. The atoms are the source of truth.
@xstate/store is the peer of @xmachines/play-atom, and not of this
package: this package reads the atom through @xmachines/play-atom and
imports the engine in no source file. Install ONE copy of it.
PlayUIProvider is the standard entry point. It wraps ActorProvider and JSONUIProvider into one composite provider. PlayRenderer is a leaf component without props. It reads the view context and renders the current spec.
Read the fields where you use them, and destructure them not.spec, fallback
and loading are GETTERS on the context object. The provider keeps the subtree across
an emission that holds the viewKey, so it publishes a new spec through the getter
instead of building the tree again — which is what keeps the focus and the caret of an
input alive while a stream writes into the view.
// ✅ The Renderer reads `view.spec` inside its own tracking scope, so it follows.
// ❌ The value freezes at the first render, and the screen stops following the actor.
const { spec } = usePlayView();
This changed in 2.3.0. Before it, every emission built the subtree again, so a
value that a component read one time was fresh because the component itself was new.
API Summary
Components
Export
Description
PlayUIProvider
The composite provider. Use it as the standard entry point
PlayRenderer
The leaf component without props. It renders the current view spec inside a provider tree
ActorProvider
The low-level provider for a custom provider composition
Hooks
Export
Description
useActor()
Returns the raw AnyPlayActor instance from the context. It throws outside a provider tree
usePlayView()
Returns the current ViewContextValue (spec, handlers, registry, store). Read the fields where you use them: spec, fallback and loading are getters. It throws outside the tree
Context
Export
Description
ActorContext
The SolidJS context of the actor. Use ActorContext.Provider directly for a custom composition
Re-exports from @xmachines/json-render-solid
This package re-exports the complete @xmachines/json-render-solid public API, so that a consumer does not need a direct dependency:
import {
// Providers
JSONUIProvider,
StateProvider,
ActionProvider,
VisibilityProvider,
ValidationProvider,
// Renderer
Renderer,
// Registry factory + hooks
defineRegistry,
useBoundProp,
useStateBinding,
useStateValue,
useStateStore,
useActions,
useAction,
useIsVisible,
useFieldValidation,
useOptionalValidation,
useVisibility,
} from"@xmachines/play-solid";
Key Types
Type
Description
PlayUIProviderProps
Props for PlayUIProvider
ActorProviderProps
Props for ActorProvider
ViewContextValue
Shape of the context value from usePlayView()
AnyPlayActor
PlayActor — the bare actor type that the context providers accept
License
MIT
@xmachines/play-solid - SolidJS renderer for the XMachines Play architecture
This package is the SolidJS rendering layer. It observes the actor atoms and
renders the UI components through @xmachines/json-render-solid. SolidJS
reactivity only triggers the re-render. The atoms are the source of truth.