/ui:build-demo-pagefrom Diorama UI
Builds a self-contained interactive demo HTML page from a screen design, synced to Paper mockups. Use when storyboarding UI walkthroughs or preparing component snippets for capture.
Ships in Diorama UI. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
One self-contained HTML file that is both a usable prototype and a deterministic performance. Two references sit beside this file:
reference/daylight-demo.html: a complete page (the Daylight screen,
light and dark), synced to Paper 5F5-0 on 2026-10-19. The sync is one
commented CSS layer at the end of the style. Open it with #demo or
#demo-light to watch the walkthrough. Renderers load it via PAGE=.reference/banner-evolution.html: a non-interactive iteration film.
Frames build one by one under a camera that moves over a fixed ground,
carried-over elements fly between frames, and the camera pulls back to the
artboard. Start here when the subject is how a design changed, not how it is used.Start with the storyboard and framing guide. If the page is already scripted, skip to render-demo-media.
get_computed_styles
for padding, gaps, radii, frame background. The artboard is the contract.
No connector? See § Reading Paper. Starting from a reference page? Diff it
first (§ Syncing to a newer design).griddy-icons glyphs (inject path data at build time; never redraw).Paper draws its canvas as HTML, so a browser on the file can read the same
numbers get_computed_styles would. Signed out is enough to read.
data-node-id, styled inline with var(--x-ui-*).
The variables are defined per node, not on the artboard, so resolve each one
through getComputedStyle(node).getPropertyValue(v) on that node.…/p-2-0/<id>) and wait before reading.data-paper-shader) are WebGL canvases with no CSS.
drawImage one into a 2D canvas and sample it: pitch, dot profile, ink,
grid phase, and whether it fades. The Full View dot ground had a 16 px
pitch, ink rgb(13 13 13 / .078) in both schemes, dots at x ≡ 8, y ≡ 0, and
no fade. None of that matched the reference page's dots.A reference page is a snapshot of an older revision. Before rendering from it:
id, x, y, w, h | bg | radius | shadow | border | type | «text», and the same rows from the page rendered at 1:1.window.runDemo() // full walkthrough; must END in the start state
window.runSnippet(name) // one component's beat; ends in the start state
window.snippetRect(name, pad) // focus rect in viewport px → the renderer's crop
window.runComposition(orient) // "landscape" | "portrait"
window.showIntroInstant() // skip the entrance so snippets start composed
Snippets are declared as { box, extend?, extendY?, grow?, growTop?, padX?, run }.
box is the focus element; extendY unions only vertically — that is how the
suggestion snippet reaches its toast without widening past 60%.
Every run must return to its first frame. Revert what it did (untick,
fold, setSugg("pending"), close the toast), move the cursor back to its
park point just outside the crop, and fade it out. That is the whole loop
seam — the renderer only verifies it.
| Hook | Effect |
|---|---|
#demo / #demo-light | render mode: no chrome, padded stage, optional light |
window.__RENDER | skip anything nondeterministic |
window.__STAGE_SCALE | draw the 1512×982 stage at k× (the screencast captures CSS px only) |
window.__PAD | stage padding in px (already × scale) |
window.__LIGHT | light theme |
window.__COMPOSE = {x, y, k} | composition mode: dotted ground, screen at x,y |
In snippet mode the page background is the frame's background, extended:
html[data-mode="light"].is-demo:not(.is-compose) {
background: linear-gradient(in oklab 180deg,
#FDFCFB var(--demo-pad), #F6F3F0 calc(100% - var(--demo-pad)));
}
html.is-demo:not(.is-compose) .app { background: transparent; }
The stops sit exactly at the frame's top and bottom, so ground and frame agree at every height. Verify by sampling pixels just inside and outside the frame edge — they must match.
Dotted ground (radial-gradient dots, gap and radius × k), the screen
bleeding off the frame, and the vignette as a ::after layer between the
dots and the screen. The screen is never under it.
html.is-compose .page::after { content: ""; position: fixed; inset: 0;
background: radial-gradient(ellipse 75% 75% at 50% 45%, transparent 55%, var(--vig-ink) 100%); }
/* dark: rgba(0,0,0,.42) · light: rgba(120,110,100,.16) */
Composition mode needs html, body, .page { height: 100% } and the gradient
on html. Without them the stage-wrap had no box: the light composition showed
only dots and the dark one was solid black.
Full View (Paper's Article Asset Full View drafts) is the whole screen at
1:1 on a 1600×1200 artboard: __COMPOSE = { x: 44, y: 109, k }, with no bleed,
.page::after { display: none } (no vignette) and no .app border. The screen's
own paint and radius separate it from the ground. The cursor's park point
(stage 1560, 1040) falls just off the artboard's right edge, so it still enters
and leaves unseen.
Read the traps table while wiring interactions, and again when a render differs from the browser or a loop does not close.
Use one measured, stationary dot lattice. Connect anchors to the actual component bounds; do not add a second dot layer, falling particles or a screen-wide shimmer. Give each component a local trace, paint and settle beat. Text uses filled skeleton slots with the glyphs hidden until the slots retire. Trace opacity stays subordinate to final ink. Animate square-to-final corners when requested; nested clips use the current outer radius minus the inset.
For a generation widget, keep the code stream moving through its fade. A freeze followed by dismissal introduces an unintended pause. Increase code volume by advancing or virtualizing rows, not by shrinking approved type. Scope any shimmer to the generating indicator. Validate changing content at two points within the fade, fixed font size, and final opacity zero.
Every interaction must show a useful cause and consequence: press → busy → completion, or changing data → matching chart. Busy retains focus and blocks repeat activation; use the current component contract when old sheet copy contradicts it. A short film should demonstrate a few legible behaviors, not compress the whole component catalogue into a tour.
Expose seek(seconds), duration and a ready promise for deterministic
capture. Seek must restore all state in either direction, including digits,
scroll, focus, code position, corner radii and cursor. Honor reduced motion.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
demo-page, ui-prototyping, storyboarding, paper-mockup, interactive-demo
npx claudepluginhub bydiorama/ui --plugin ui8 skills in this plugin
/animate-app-interactionsAnimate state changes in an app that consumes Diorama components. Use when a count, label, icon or list should animate, a transition does not replay, or an interaction must respect reduced motion./apply-effectsApply glass, grain, sheen, glow, shimmer, ink or shaders to Diorama components. Use when adding texture, emphasis, a gradient ground or a loading halo without changing the component API./compare-ui-to-designMeasure a rendered screen against a Paper or Figma design. Use when asked to match a frame, explain a spacing or size difference, export a reference, or set up pixel diffs in an app./design-componentDesign a component and its states before implementation, as a contract in code drawn in Paper or Figma. Use when turning references into a token-based spec, extending a component sheet, drawing motion frames or preparing a handoff./hydrate-componentsUse Diorama components in Astro, SSR and static exports. Use when deciding what must hydrate, composing compound components in an island, or debugging a control that looks right but does nothing./polish-interfacePolish an interface built with Diorama components. Use when spacing, radii, elevation, type, icon alignment, hit areas or interaction states look or feel wrong without a specific design frame to compare.Other plugins' skills for the same job