@kimoxstudio/renderer
v0.2.1
Published
Document renderer and client store for kimox-fw.
Readme
@kimoxstudio/renderer
Document renderer.
Turns a PageDocument into a React tree using a template registry, validating
each node's props against its Zod schema and falling back visibly (rather than
crashing) on a missing template or invalid props.
import { Renderer } from "@kimoxstudio/renderer";
<Renderer document={doc} registry={registry} />The ./client subpath adds a tiny external store for state that must be shared
across sibling templates (templates render as independent trees, so useState
in one is invisible to the others):
"use client";
import { createClientStore, useClientStore } from "@kimoxstudio/renderer/client";
export const langStore = createClientStore("es", { key: "lang" });
// in any client template: const lang = useClientStore(langStore);Part of kimox-fw
kimox-fw is a JSON-document + template site framework for Next.js (App Router): pages are declarative JSON documents rendered by Zod-typed templates, with content stored in git and edited through a visual admin using draft branches ("variations").
Scaffold a whole site with npx create-kx-app.
MIT © Kimox Studio
