artboards-design
v0.0.2
Published
A harness-agnostic UI design tool built for coding agents.
Maintainers
Readme

Artboards
Design UI as code. You write artboards as JSX/TSX components using a set of built-in layers. The CLI type-checks them, lays them out, reports layout problems, renders PNG screenshots and prints layer trees. It also opens a browser viewer where people review the designs and leave comments.
It was built for coding agents. An agent can write a design, check it with lint, look at it with
render, and fix whatever a reviewer commented on.
The website, is itself a design made with artboards!
import { Column, Frame, Row, Text } from "artboards";
export function Home() {
return (
<Frame width={390} height={844} fill="#ffffff">
<Column width="fill" height="fill" padding={16} gap={12} align="stretch">
<Text fontSize={24} fontWeight={700}>Title</Text>
<Row height={44} padding={[0, 12]} align="center" fill="#f3f4f6" cornerRadius={8}>
<Text>Label</Text>
</Row>
</Column>
</Frame>
);
}How it works:
- Layout uses flexbox and grid (Taffy) and rendering uses Skia (CanvasKit), so a PNG from the CLI looks the same as the design in the browser viewer.
- Every exported component in the file you pass is one artboard. Components you don't export are reusable pieces. A design can be split across several files with relative imports.
useVariantdeclares the states a reviewer should be able to switch between, such as loading, empty, error or the steps of a flow.onClickhandlers make a prototype that runs in the viewer's Play mode.- Fonts (Inter, Noto Sans SC, Fraunces, JetBrains Mono) are bundled. Local images and font files can be imported.
Requirements
- Node.js 24 or later
Install
npm install -g artboards-designCheck that it worked:
artboards --versionTo run it without a global install, use npx -p artboards-design artboards <command> wherever these docs
say artboards.
A design project needs no setup of its own. It has no package.json, no tsconfig.json and no
node_modules. A design file imports from "artboards", and the CLI supplies that module and its types.
The only other imports allowed are relative files: code (.jsx, .tsx, .ts, .js), images and fonts.
Usage
Save the example above as design.tsx, then you can run the following commands on the design file:
| Command | What it does |
|---|---|
| lint <file> [--variant name=value] [--json] | Type-checks the file, renders every artboard and reports layout problems such as overflow or clipped text. Exits with 1 when there are errors. |
| render <file> [-f Name] [--variant name=value] [-s 2] [-o out.png] [--transparent] | Writes PNG screenshots. The default path is out/<file>.<Artboard>.png. Artboards sit on white, as in the viewer, unless --transparent. With --at and --to, it plays the motion and writes one frame or a filmstrip (see below). |
| inspect <file> [-f Name] [--variant name=value] [--json] | Prints each artboard's layer tree with its position, size, source line and variants. With --at and --to, it lists the layers that change over time and their values at each moment. |
| dev <file> [-p 4400] [--host 127.0.0.1] | Starts the browser viewer, which reloads on every save. Reviewers can inspect layers, switch variants, try Play mode (P) and comment. Keeps running until stopped. |
| build <file> [-o dir] | Writes the viewer and the design as a static site (default: out/<file>/) for reviewers who don't have the CLI. |
| comments <file> [--all] [--resolve id] [--import file] [--json] | Lists open review comments, each with the source line of the layer it is on. --resolve marks one as done. --import adds comments exported from a build site. |
| docs | Prints the full DSL reference: the guide plus the TypeScript API. |
Run artboards <command> --help for every option.
Reviewing a design
- Run
artboards dev design.tsxand open the URL. Comments made in the viewer are saved todesign.comments.json, next to the design file. For reviewers who don't have the CLI, runartboards build design.tsxto build the design as a static site. Their comments stay in their browser until they export them. - Run
artboards comments design.tsxto list what needs doing. Fix each item, then runartboards comments design.tsx --resolve <id>. Import the exported comments withartboards comments design.tsx --import design.comments.json.
Checking motion
Designs animate with useSpring and useAnimationTime, and play in the viewer's Play mode. From the CLI,
--to plays a transition between two variant states and --at picks the moments, on a clock that steps at
60 fps, so every run gives the same frames:
artboards render design.tsx -f Checkout --to Sheet=open # filmstrip until the springs settle
artboards render design.tsx -f Checkout --to Sheet=open --at 120 # one frame, 120 ms in
artboards inspect design.tsx -f Checkout --to Sheet=open --at 0..400:40 # the values that change, per frame
artboards render design.tsx -f Splash --at 0..800:100 # from mount: entrances and loopsUsing it with a coding agent
The agent works through the CLI. It needs artboards on its PATH (see Install) and the DSL
reference. There is no plugin or server to set up.
- Give the agent the reference.
artboards docsprints everything an agent needs to write valid designs: sizing and layout rules, text, images and fonts, variants, interactions, what doesn't exist in the DSL, and the full typed API. Tell the agent to read it before writing a design. - Add instructions to the design project. Copy the block below into the project's
AGENTS.md,CLAUDE.mdor the equivalent file for your agent. - Run the viewer yourself.
artboards dev <file>keeps running, so start it in your own terminal, not the agent's. Review and comment in the browser, then ask the agent to address the comments.
## Designing with Artboards
UI designs in this project are JSX/TSX files written in the Artboards DSL.
- Before writing or editing a design, run `artboards docs` and read all of it. The DSL is not HTML,
CSS or React Native. Use only the elements and props it documents.
- Every exported component of the design file is one artboard. Import only from "artboards" and
from relative files.
- After every edit, run `artboards lint <file>` and fix every error and warning before moving on.
- To see the result, run `artboards render <file> --frame <Name> --scale 2` and open the PNG.
Use `artboards inspect <file> --frame <Name>` for exact positions, sizes and source lines.
- To check an animation, render a filmstrip of it: `artboards render <file> --frame <Name> --to Name=value` for a
change between variants, or `--at 0..800:100` from mount. `inspect` with the same flags gives the numbers.
- Put each state a reviewer should see (loading, empty, error, a step of a flow) in a variant with
`useVariant`. Check it with `--variant Name=value` on lint, render and inspect.
- When asked to address review feedback, run `artboards comments <file>`, fix each comment at the
source line it gives, then run `artboards comments <file> --resolve <id>`.
- Don't run `artboards dev`. It keeps running, and the human runs it to review.
- `lint`, `inspect` and `comments` take `--json` for structured output.Development
Building from source needs pnpm as well as Node.js.
Source layout:
src/cli/: the CLI and dev serversrc/viewer/: the browser viewersrc/shared/: the DSL, layout, painting and lint rules, used by both the CLI and the viewersrc/docs/: the guide and declarations template thatartboards docsis built fromexamples/artboards/: the project's own images and website, designed with artboards
