Skip to content
Eskais UI

Get started

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.

npx shadcn@latest init -t vite -n app -b base -p nova --no-monorepocd app && npx shadcn@latest registry add "@eskais=https://raw.githubusercontent.com/p-otero/eskais-ui/main/public/r/{name}.json"npx shadcn@latest add @eskais/theme @eskais/card @eskais/button @eskais/eskais-mockup-cli --overwrite -y# write .mockups/hello/screen.tsx (below), then:bun .agents/tools/eskais-mockup/cli.ts validate hello
  1. Create a Vite app with Tailwind and a components.json, without prompts.
  2. Add the @eskais registry to components.json.
  3. Install the theme, two components and the mockup CLI, which lands in .agents/tools/eskais-mockup (see Install). --overwrite replaces the button.tsx and utils.ts that shadcn init wrote, and -y accepts the new theme.
  4. Write the screen, put @layer ui-sdk; on the first line of src/index.css (see Installation), and validate.
.mockups/hello/screen.tsx
import { Button } from "@/components/ui/button"import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
export default function Hello() {  return (    <main className="flex flex-col gap-section p-inset-surface font-sans">      <Card>        <CardHeader>          <CardTitle>Atlas workspace</CardTitle>          <CardDescription>3 members · Team plan</CardDescription>        </CardHeader>        <CardContent>          <Button>Invite people</Button>        </CardContent>      </Card>    </main>  )}

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.

ok .mockups/hello/out.html  460 kB (282 kB js, 177 kB css, 75 kB fonts)install noneproposed nonesdkParts nonegaps nonescreenshots 0 (1 page; no screenshot: out.html)

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):

npx skills@1.8.1 add p-otero/eskais-ui@v0.2.20 --full-depth --skill eskais-mockup -a universal -y

Then ask for a screen in plain words:

Prompt
Make a mockup of a Team settings screen: the members with their role, a way toremove one, an Invite button, and a place to drop a team logo. Validate it andtell me what it would take to build.
  1. The agent runs inspect to learn the project's components instead of reading their sources, and inspect --registry or --sdk when a part is missing.
  2. It writes screen.tsx, fixtures.ts and, when needed, parts/ and gaps.ts, walking the five levels in order.
  3. It runs validate until it prints ok, fixing each file:line:col line.
  4. It builds a page per state and theme, captures each as a PNG (it never reads the HTML) and runs gallery.
  5. It presents every screen: each screenshot as an image in its reply, with its out-*.html path, a link to the gallery and a count that matches the one gallery printed. 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.

npx shadcn@latest add @eskais/eskais-mockup-clibun .agents/tools/eskais-mockup/cli.ts --versionbun .agents/tools/eskais-mockup/cli.ts inspectbun .agents/tools/eskais-mockup/cli.ts validate team

--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.

# from your project; <eskais-ui checkout> is the path to your checkout of eskais-uibun <eskais-ui checkout>/packages/mockup/src/cli.ts validate team# or link it once with Bun: adds node_modules/.bin/eskais-mockup until the next npm or pnpm install(cd <eskais-ui checkout>/packages/mockup && bun link)bun link @eskais/mockupbunx eskais-mockup validate team

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.

import { Button } from "@/components/ui/button"import { Card, CardAction, CardContent, CardHeader, CardTitle } from "@/components/ui/card"

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.

import { Badge } from "@registry/badge" // not installed: fetched into .mockups/.registry/<ref>/
inspect --registry
@eskais 0dc2acb842db  107 of 114 component items not installed  (.mockups/.registry/0dc2acb842db)  acceptance-list          A list of pass, fail and unverified criteria with evidence, and a segmented AcceptanceBar on the UI SDK Meter…  accordion                UI SDK Accordion parts: triggers in headings, Enter and Space toggle, animated panels on the density tokens.  …

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.

// .mockups/team/parts/member-row.tsximport { Badge } from "@registry/badge"import { Button } from "@/components/ui/button"
import type { Member } from "../fixtures"
export type MemberRowProps = { member: Member; onRemove?: (id: string) => void }
export function MemberRow({ member, onRemove }: MemberRowProps) {  return (    <li className="flex items-center justify-between gap-items py-inset-item">      <span className="flex items-center gap-inline text-body">        {member.name}        <Badge variant="secondary">{member.role}</Badge>      </span>      <Button variant="ghost" size="sm" onClick={() => onRemove?.(member.id)}>        Remove {member.name}      </Button>    </li>  )}

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.

// .mockups/team/parts/avatar-drop.tsximport { FileInput, FileInputDropzone, FileInputTrigger } from "@ui-sdk/react/file-input"
import { buttonVariants } from "@/components/ui/button"
// sdk-reason: Eskais has no file input; UI SDK's FileInput gives the dropzone, the picker and the agent actionsexport function AvatarDrop() {  return (    <FileInput accept="image/*">      <FileInputDropzone className="flex flex-col items-center gap-items rounded-surface border border-dashed border-input-strong p-inset-surface text-body-sm text-muted-foreground">        Drop a team logo here        <FileInputTrigger className={buttonVariants({ variant: "outline", size: "sm" })}>Choose a file</FileInputTrigger>      </FileInputDropzone>    </FileInput>  )}
inspect --sdk
$ bun .agents/tools/eskais-mockup/cli.ts inspect --sdk@ui-sdk/react 0.1.0-beta.12  68 public subpaths  accordion            Accordion, AccordionHeader, AccordionItem, AccordionPanel, …  …$ bun .agents/tools/eskais-mockup/cli.ts inspect --sdk file-input@ui-sdk/react/file-input  (node_modules/@ui-sdk/react/dist/file-input.d.ts)import { FileInput, FileInputDropzone, FileInputItem, FileInputItemRemove, FileInputList, FileInputTrigger } from "@ui-sdk/react/file-input"parts FileInput, FileInputDropzone, FileInputItem, FileInputItemRemove, FileInputList, FileInputTrigger

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.

// .mockups/team/gaps.tsexport const gaps = [  {    component: "Button",    missing: "a split button with a menu of roles",    reason: "Invite needs a default role and a menu of the others; no Eskais part or composition gives one control",  },]

Commands

CommandWhat it does
inspectPrints 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 --registryLists 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 nameBundles .mockups/name/screen.tsx into out.html, fetching @registry/ items first, and writes manifest.json.
validate nameBuilds 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.
FlagCommandsEffect
--registryinspectLists the registry items the project hasn't installed.
--sdkinspectLists the installed UI SDK subpaths, or details the named ones.
--jsoninspect, galleryPrints JSON instead of text.
--gallerybuild, validateWrites .mockups/gallery.html after a passing run and prints its path and count last.
--project dirallThe project folder, when it isn't the current one.
--css fileallAnother stylesheet; the tsconfig stays the project's.
--tsconfig fileallAnother tsconfig for the aliases and the type check.
--tailwind dirallA 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|allbuild, validateRenders a named state from fixtures.ts into out-<state>-<theme>.html; all builds each (--out takes {state}).
--max nbuild, validateHow many problems to print (20 by default).
--theme namebuild, validateApplies a theme, such as compact.
--scheme light|dark|systembuild, validateFixes the colour scheme; system (the default) follows the viewer.
--out filebuild, validateWhere 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

.mockups/  .gitignore        # "*", written by build: mockups and the cache stay out of the repository  .registry/<ref>/  # registry items fetched for @registry/ imports  wrapper.tsx       # optional, shared: ({ children }) => providers  team/    screen.tsx      # default-exports the screen; data comes in as props    fixtures.ts     # the types and a sample of the data    parts/          # optional: components the screen proposes (levels 3 and 4)    gaps.ts         # optional: what no level could give (level 5)    manifest.json   # written by build    out.html        # written by build: one offline file
  • screen.tsx default-exports one component whose data comes in as props, defaulting to the fixtures. Presentational only: no fetching, no window, no router. Behaviour is React state.
  • fixtures.ts types the data and exports a sample. Reuse the project's own types when they import through an alias. It may export states, an object of named states, each the props the screen gets in it; build --state empty renders one, --state all every one.
  • parts/ and gaps.ts are levels 3 to 5. wrapper.tsx is optional and shared by every mockup: add it when a screen needs a provider the app entry installs.
  • manifest.json records the date, theme and scheme, hashes of the screen and fixtures, the project components the page bundled, install, proposed, sdkParts, gaps and the size.
.mockups/team/screen.tsx
import { useState } from "react"
import { Button } from "@/components/ui/button"import { Card, CardAction, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
import { sampleMembers, type Member } from "./fixtures"import { AvatarDrop } from "./parts/avatar-drop"import { MemberRow } from "./parts/member-row"
export default function Team({ members = sampleMembers }: { members?: Member[] }) {  const [list, setList] = useState(members)  return (    <main className="flex flex-col gap-section p-inset-surface font-sans">      <Card>        <CardHeader>          <CardTitle>Team</CardTitle>          <CardAction>            <Button>Invite people</Button>          </CardAction>        </CardHeader>        <CardContent className="flex flex-col gap-group">          <ul className="flex flex-col divide-y">            {list.map((member) => (              <MemberRow key={member.id} member={member} onRemove={(id) => setList((current) => current.filter((entry) => entry.id !== id))} />            ))}          </ul>          <AvatarDrop />        </CardContent>      </Card>    </main>  )}
.mockups/team/fixtures.ts (states)
export type ScreenProps = { members?: Member[]; loading?: boolean; error?: string }
// one entry per named state: the props the screen gets in itexport const states = {  empty: { members: [] },  loading: { loading: true },  error: { error: "The members could not be loaded" },} satisfies Record<string, ScreenProps>

What validate checks

  1. The page is one offline file: no external script, stylesheet, image, @import or url() that isn't inlined, and no React development build.
  2. No viewport height units (h-screen, 100dvh) in the mockup's own files (viewport-unit); an installed block such as Shell may size itself to the viewport.
  3. No network: fetch, XMLHttpRequest, WebSocket or EventSource in the sources (no-network).
  4. No bare controls: a <button>, <input>, <select> or <textarea> instead of the project's own part (bare-control).
  5. 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).
  6. 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).
  7. Types: bun check on the mockup with the project's tsconfig, so a prop a component doesn't take fails (type). When the root tsconfig.json only lists references, as Vite's template does, it uses the referenced config that sets jsx.
  8. 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:

A screen that passes
$ bun .agents/tools/eskais-mockup/cli.ts validate teamok .mockups/team/out.html  485 kB (305 kB js, 179 kB css, 75 kB fonts)install 2: badge, toneproposed 2: AvatarDrop (0 props), MemberRow (2 props)sdkParts 1: AvatarDrop ← @ui-sdk/react/file-inputgaps 1: Button (a split button with a menu of roles)screenshots 0 (1 page; no screenshot: out.html)
A copy with four problems
$ bun .agents/tools/eskais-mockup/cli.ts validate broken.mockups/broken/parts/avatar-drop.tsx:1:1 sdk-reason add a line "// sdk-reason: <why Eskais cannot do this>" above the AvatarDrop component.mockups/broken/parts/avatar-drop.tsx:9:160 shadcn/no-raw-colors bg-white is a raw colour; use a theme token (bg-card, text-muted-foreground, border-input).mockups/broken/parts/avatar-drop.tsx:9:169 shadcn/no-arbitrary-values w-[13px] is an arbitrary size; use the Tailwind scale or a theme token.mockups/broken/screen.tsx:32:11 bare-control a bare <button> is invisible to agents and unstyled; use the project's own control partinstall 2: badge, toneproposed 2: AvatarDrop (0 props), MemberRow (2 props)sdkParts nonegaps 1: Button (a split button with a menu of roles)screenshots 0 (1 page; no screenshot: out.html)

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:

# one page per state and theme, named out-<state>-<theme>.htmlbun .agents/tools/eskais-mockup/cli.ts build team --scheme light --out .mockups/team/out-light.html# every state that fixtures.ts exports in states: out-empty-dark.html, out-error-dark.html…bun .agents/tools/eskais-mockup/cli.ts build team --state all --scheme dark# a PNG with the same name beside each page, from any browser; headless Chrome:chrome --headless --hide-scrollbars --window-size=1280,800 \  --screenshot=.mockups/team/out-empty-dark.png "file://$PWD/.mockups/team/out-empty-dark.html"bun .agents/tools/eskais-mockup/cli.ts gallery
gallery
team  default  light  .mockups/team/out-light.png  .mockups/team/out-light.htmlteam  empty  dark  .mockups/team/out-empty-dark.png  .mockups/team/out-empty-dark.htmlno screenshot: .mockups/team/out-saving-dark.html (capture it as out-saving-dark.png)gallery .mockups/gallery.html  2 screenshots: 1 screen, 2 states, 2 themes

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.

The agent's reply
### team
![team, default state, light theme](.mockups/team/out-light.png)`.mockups/team/out-light.html`
![team, empty state, dark theme](.mockups/team/out-empty-dark.png)`.mockups/team/out-empty-dark.html`
2 of 2 screenshots. All of them: .mockups/gallery.html

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

MeasureA: hand-written HTMLB: @eskais/mockup TSXB vs A
Model calls9363−32%
Output tokens143k56.5k−60%
of which reasoning96.9k38.3k−60%
Uncached input tokens239k152k−36%
Cache read tokens13.9M5.84M−58%
Cost (API-equivalent)$0.163$0.074−55%
Wall time (approx.)~28 min~12 min−57%
Agent deliverable89.6 KB, 2,720 lines of HTML21 KB screen.tsx + 1.5 KB fixtures.ts
Built page90 KB887 KB (components and fonts inlined)

The two screens

Both screenshots follow the site's light or dark theme.

The API keys screen written as one HTML file: an app bar, a page header with Create key, Active and Revoked tabs, and a table of four keys with scope badges and row menus.
A: hand-written HTML
The same API keys screen built from the project's own components: a page header with Create key, Active and Revoked tabs, and a card with a table of four keys, scope badges and row menus.
B: TSX with @eskais/mockup

What changed

  • B needed one validate run: 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.
One screen, one run
This is n=1: one screen, one model, one run per side. The direction is clear, but repeat it with more screens and models before treating the numbers as firm. The raw numbers and how to repeat the experiment are in BENCHMARKS.md.