Mockups
Sketch a screen as TSX with your project's own components and fixture data, then build it into one offline HTML file and check it.
Quickstart
From an empty folder to a validated out.html: four commands and one file. You need Node with npx and Bun 1.4 or newer.
- Create a Vite app with Tailwind and a components.json, without prompts.
- Add the
@eskaisregistry tocomponents.json. - Install the theme, two components and the mockup CLI, which lands in
.agents/tools/eskais-mockup(see Install).--overwritereplaces thebutton.tsxandutils.tsthatshadcn initwrote, and-yaccepts the new theme. - Write the screen, put
@layer ui-sdk;on the first line ofsrc/index.css(see Installation), and validate.
validate builds the page and prints where it wrote it; open that file in a browser. In an existing project with a components.json, skip straight to the last step.
For agents
An agent follows the same loop with the eskais-mockup skill. Install it into the project (see Agent skills for pointing your agent at it):
Then ask for a screen in plain words:
- The agent runs
inspectto learn the project's components instead of reading their sources, andinspect --registryor--sdkwhen a part is missing. - It writes
screen.tsx,fixtures.tsand, when needed,parts/andgaps.ts, walking the five levels in order. - It runs
validateuntil it printsok, fixing eachfile:line:colline. - It builds a page per state and theme, captures each as a PNG (it never reads the HTML) and runs
gallery. - It presents every screen: each screenshot as an image in its reply, with its
out-*.htmlpath, a link to the gallery and a count that matches the onegalleryprinted. Then it reports the summary: what to install, the parts it proposes, the UI SDK parts it used and why, and the gaps.
The skill runs the CLI from .agents/tools/eskais-mockup, and installs it with shadcn when it's missing. Every rule it follows is on this page.
Install
The CLI is a registry item, eskais-mockup-cli: shadcn copies its source into .agents/tools/eskais-mockup and Bun 1.4 or newer runs it from there. It has no npm dependencies and needs no install step. It reads your project's components.json, its stylesheet and its tsconfig aliases from the current folder or the nearest one above it, and builds with the project's own Tailwind and React, so the project can use npm, pnpm or Bun.
--version prints the release it came from. Update it with the registry, like a component: npx shadcn@latest add @eskais/eskais-mockup-cli --overwrite. The folder starts with a dot, so TypeScript's include globs leave it out of the app's type-check and build; a linter that walks every file still reads it, and it passes Vite's ESLint config and lint-rules. It needs a TypeScript project (tsx: true in components.json): in a JavaScript one shadcn renames the files to .js, and Bun can't run them.
From a checkout
Working on eskais-ui itself, run the same CLI from the repository's packages/mockup/src, by path or linked with Bun. bun link @eskais/mockup leaves package.json alone, but the next npm install or pnpm install removes the link; bun unlink in the checkout unregisters it.
The five levels
Each part of a screen comes from the first level that can express it, and no level is skipped. The levels keep a mockup honest: it shows what the project can build today, and records what it can't.
1. The project's components
Whatever the project has, its own or installed from a registry, through its aliases. inspect lists them and inspect Button Card prints each one's import line, props and variants.
2. Registry items the project hasn't installed
Import an Eskais item as @registry/<name>. build fetches it and its registryDependencies from the registry URL in components.json into .mockups/.registry/<ref>/ (the commit pinned in the URL, or a hash of the URL), compiles them into the page and records the install command in manifest.install. Only inspect and build use the network; the page stays offline.
3. A composition in parts/
A component the screen proposes, built from levels 1 and 2 in .mockups/<name>/parts/. Each one with a <Name>Props type is recorded in manifest.proposed with its props.
4. UI SDK primitives, with a reason
Only for behaviour Eskais has no part for. Import from a public @ui-sdk/react/<subpath>, style it only with the project's tokens, cn/cva and visual parts, and say why on a // sdk-reason: line. It's recorded in manifest.sdkParts; a part without the line fails validate, and a primitive that duplicates an installed part (a dialog, a select) is a warning.
5. A recorded gap, never a raw control
No bare <button>, <input>, <select> or <textarea>. When no level reaches the design, leave that part out and record it in gaps.ts, so a review sees what the screen would cost.
Commands
| Command | What it does |
|---|---|
inspect | Prints the project, its stylesheet, Tailwind and React versions, themes, providers in the app entry, whether a .mockups/wrapper.tsx exists, and the value exports of every file in the ui, components, lib and hooks aliases. |
inspect Names… | Prints each component's import line, its *Props type and its cva variants, about 200 tokens each: a cheaper read than the source. |
inspect --registry | Lists the items of each registry in components.json that the project hasn't installed, with one-line descriptions, and caches the registry index under .mockups/.registry. |
inspect --sdk [name…] | Without a name, lists the public @ui-sdk/react subpaths the project installs and their parts. With names, prints each primitive's import line and parts. |
build name | Bundles .mockups/name/screen.tsx into out.html, fetching @registry/ items first, and writes manifest.json. |
validate name | Builds the page, checks the page and the sources, prints every problem and then the install, proposed, sdkParts, gaps and screenshots summary. |
gallery [dir] | Writes dir/gallery.html (.mockups by default) with every out-*.png screenshot, grouped by screen, state and theme and linked to its page, then lists them and prints the total. Exits 1 when there are none. |
clean [name] | Removes one mockup, or the whole .mockups folder without a name. |
| Flag | Commands | Effect |
|---|---|---|
--registry | inspect | Lists the registry items the project hasn't installed. |
--sdk | inspect | Lists the installed UI SDK subpaths, or details the named ones. |
--json | inspect, gallery | Prints JSON instead of text. |
--gallery | build, validate | Writes .mockups/gallery.html after a passing run and prints its path and count last. |
--project dir | all | The project folder, when it isn't the current one. |
--css file | all | Another stylesheet; the tsconfig stays the project's. |
--tsconfig file | all | Another tsconfig for the aliases and the type check. |
--tailwind dir | all | A folder whose packages resolve Tailwind, such as apps/web in a workspace where only the app installs it. Without it, the workspace root, its packages and pnpm's or Bun's store are searched. |
--state name|all | build, validate | Renders a named state from fixtures.ts into out-<state>-<theme>.html; all builds each (--out takes {state}). |
--max n | build, validate | How many problems to print (20 by default). |
--theme name | build, validate | Applies a theme, such as compact. |
--scheme light|dark|system | build, validate | Fixes the colour scheme; system (the default) follows the viewer. |
--out file | build, validate | Where to write the page instead of out.html. |
Exit codes: 0 fine, 1 problems to fix, 2 an environment or usage error, such as no components.json, an unknown flag, an unreachable registry, or a fetched item whose npm packages the project doesn't declare.
The files
screen.tsxdefault-exports one component whose data comes in as props, defaulting to the fixtures. Presentational only: no fetching, nowindow, no router. Behaviour is React state.fixtures.tstypes the data and exports a sample. Reuse the project's own types when they import through an alias. It may exportstates, an object of named states, each the props the screen gets in it;build --state emptyrenders one,--state allevery one.parts/andgaps.tsare levels 3 to 5.wrapper.tsxis optional and shared by every mockup: add it when a screen needs a provider the app entry installs.manifest.jsonrecords the date, theme and scheme, hashes of the screen and fixtures, the project components the page bundled,install,proposed,sdkParts,gapsand the size.
What validate checks
- The page is one offline file: no external script, stylesheet, image,
@importorurl()that isn't inlined, and no React development build. - No viewport height units (
h-screen,100dvh) in the mockup's own files (viewport-unit); an installed block such asShellmay size itself to the viewport. - No network:
fetch,XMLHttpRequest,WebSocketorEventSourcein the sources (no-network). - No bare controls: a
<button>,<input>,<select>or<textarea>instead of the project's own part (bare-control). - The project's imports: an alias, a relative path,
@registry/or a package the project declares (import-specifier); UI SDK only from its public subpaths (sdk-subpath). - Parts: theme tokens and the Tailwind scale in
parts/, no raw colours or arbitrary sizes (shadcn/no-raw-colors,shadcn/no-arbitrary-values), and a// sdk-reason:line in a part that uses a UI SDK primitive (sdk-reason). - Types:
bun checkon the mockup with the project's tsconfig, so a prop a component doesn't take fails (type). When the roottsconfig.jsononly listsreferences, as Vite's template does, it uses the referenced config that setsjsx. - A server render: the screen, inside the wrapper, renders without throwing (
render).
Each problem is one line, file:line:col rule message, so an agent can fix it without opening the page. After the problems, five lines summarize what the screen needs: the items to install, the parts it proposes, the UI SDK primitives it used, the gaps and how many screenshots sit beside its pages. Both runs below are real, on the Team screen above in the quickstart's app:
Never read out.html itself: it is hundreds of kilobytes of inlined JavaScript and CSS. Open it in a browser or the host's preview.
Present every screen
A mockup is for looking at, so it isn't done until the person has seen every screen in every state and theme. Build one page per state and theme, named out-<state>-<theme>.html in the mockup's folder (the theme is the last segment: light, dark, system or a theme name such as compact), and capture each as a PNG with the same name beside it, with any browser. Then run gallery:
gallery.html groups the screenshots by screen, then state, then theme, under headings, with alt text such as team, empty state, dark theme and each image linked to its page. It is one file with relative paths, lazy-loaded images, no script and no network: it opens from file://, and the .mockups folder can be zipped and shared. With no screenshots, gallery writes nothing, says so and exits 1; a page with no PNG is named so it can be captured.
An agent with the eskais-mockup skill finishes every mockup task this way. It embeds every PNG in its reply with its out-*.html path, links the gallery and checks that the number of images equals the count gallery printed. It never only lists or describes a screen the person hasn't seen, and a coordinator relaying a worker's mockups keeps the images too.
Why mockups in TSX
An agent asked for a mockup usually writes one HTML file. It looks right, but it re-implements the styles, dialogs, menus and keyboard handling by hand, and nothing of it survives into the real screen. We measured the difference on one screen.
Method
- The same model on both sides, DeepSeek V4.1 Flash with maximum thinking, the same brief and fresh threads. Neither side had built the screen before.
- The screen, "API keys": a page header with an action; Active and Revoked tabs with counts; a six-column table with scope badges and a row menu; a create-key dialog with a required name, scope checkboxes, an expiry select and a show-once key with Copy; a revoke confirmation that moves rows between tabs; an empty state; light and dark from
prefers-color-scheme. - A wrote one hand-written HTML file. B wrote a TSX mockup and built it with this CLI.
- Both covered the whole brief with no console errors.
- The numbers were measured from the provider's usage logs, not reported by the agents. Cost is what the tokens would cost at API prices.
Results
| Measure | A: hand-written HTML | B: @eskais/mockup TSX | B vs A |
|---|---|---|---|
| Model calls | 93 | 63 | −32% |
| Output tokens | 143k | 56.5k | −60% |
| of which reasoning | 96.9k | 38.3k | −60% |
| Uncached input tokens | 239k | 152k | −36% |
| Cache read tokens | 13.9M | 5.84M | −58% |
| Cost (API-equivalent) | $0.163 | $0.074 | −55% |
| Wall time (approx.) | ~28 min | ~12 min | −57% |
| Agent deliverable | 89.6 KB, 2,720 lines of HTML | 21 KB screen.tsx + 1.5 KB fixtures.ts | |
| Built page | 90 KB | 887 KB (components and fonts inlined) |
The two screens
Both screenshots follow the site's light or dark theme.


What changed
- B needed one
validaterun: the problems came back as lines to fix, not as screenshots to read. - B's 21 KB of TSX uses the project's real components and can be the start of the real screen. A's 2,720 lines of HTML are thrown away and re-implement dialogs, menus, focus and keyboard handling by hand.
- The built page is bigger for B (887 KB against 90 KB) because the components, React and fonts are inlined. Nobody reads it; it opens offline.

