Documentation & Contracts
Dynamic UI separates what a screen says (strict Zod JSON contracts) from how a host draws it (React + semantic CSS tokens).
Embed in React
Validate any payload with readView, render with <View />, and feed every user click back through afterView.
import { readView, afterView, partsOf } from "@hopper/dynamic-ui/view";
import { OWN_PARTS } from "@hopper/dynamic-ui/own-parts";
import { View, OWN_DRAWERS } from "@hopper/dynamic-ui/view-react";
import "@hopper/dynamic-ui/view.css";
const parts = partsOf(OWN_PARTS);
const checked = readView(payload, parts);
if (checked.ok) {
return <View view={checked.view} drawers={OWN_DRAWERS}
onAct={(act) => setView((v) => afterView(v, act, parts))} />;
}Host look tokens
Dynamic UI never hardcodes colors. Declare your host tokens once and every part adapts across light and dark modes.
.dyn-view, .dyn-stage {
--dyn-ground: var(--surface);
--dyn-ink: var(--ink);
--dyn-hot: var(--highlight);
--dyn-font: var(--sans);
--dyn-font-display: var(--display);
--dyn-radius: var(--radius-card);
}Contract reference
What a scene says- Every kind of thing, form, act, player, shape and refusal in the scene contract.
For an app- One read that answers a scene, and one row that lists it.
The stage- Embed a live stage in any React screen, in your own look.
- What a scene says — Every kind of thing, form, act, player, shape and refusal in the scene contract.
- For an app — One read that answers a scene, and one row that lists it.
- The stage — Embed a live stage in any React screen, in your own look.
Asset packs
Distribute verified meshes, custom looks, and extension parts via hopper.dynamic-ui.pack.v1 manifests.
{
"schemaVersion": "hopper.dynamic-ui.pack.v1",
"id": "hopperlabs.studio-assets",
"version": "0.9.0",
"baseUrl": "https://assets.hopperlabs.ai/dynamic-ui/0.9.0",
"meshes": {
"gear-pinion": {
"path": "meshes/gear-pinion.mesh",
"digest": "sha256:34873a57f09ff56e27465c8d50dacd79e9871fef266b9a369aeda9c4230175f3",
"bytes": 1186,
"triangles": 416,
"label": "Drive pinion"
}
},
"looks": {},
"parts": {}
}