All docs
Recipes3 min readUpdated

Check visual changes mid-edit with uiverify check

Preview a UI edit's visual impact with uiverify check: render just what you touched on the real fleet, diff against the CI baseline, no PR check, no moved baseline.

uiverify check is the interactive preview build: the edit-loop counterpart to the CI uiverify upload. You have changed a component and want to know now whether it changed anything visually, and whether that change is intended, without opening a pull request or waiting for CI.

How is uiverify check different from a CI build?

uiverify check posts no GitHub check and never advances a CI baseline, so it is invisible on the pull request. Otherwise it is a real build: it renders on the same fleet and diffs against the same resolved CI baseline a CI build would, so the answer is authoritative rather than a local screenshot that will not match Linux. Accepting a preview build writes a branch-scoped preview baseline, so your own accepted change stops re-flagging on the next check while CI's baseline stays untouched.

A changed verdict exits 0. It is the expected result to review, not a gate. Only a real failed or blocked, or an operational error, exits 1; a malformed command line exits 2.

Scope the check to what you touched

Scoping is where check is the opposite of CI. CI computes the transitive affected set from the dependency graph, and editing one primitive can mark a third of the suite affected. That is correct for CI, which writes the baseline and cannot under-render, but it is the wrong default for an edit loop: slow, expensive, and it drowns the signal you want.

So you choose what to render: the stories for the component you are editing, plus the specific places it matters, not everything the graph lights up. Under-scoping is safe here because a preview build is never a baseline, so the worst case is you did not preview a story you did not ask about, and the exhaustive CI build catches it later on your pull request.

Storybook: name what to render with --target

Storybook builds the whole suite (there is no single-story build), so --target is required: you name what to render. The build is monolithic; only the named stories actually render on the fleet. Pass --target per id, each an exact story id or an anchored glob.

bash
npm run build-storybook
uiverify check --static-dir storybook-static \
  --target 'components-button--*' --target 'pages-checkout--default'

Playwright, Vitest, and Bun archives: --target is optional

Run only the tests you care about to produce the capture archive, then check it. The archive already contains just those captures, so the uploaded artifact is the render set and no --target is needed. You can still pass --target to narrow further; it matches the capture ids the SDK emitted.

bash
npx playwright test tests/checkout.spec.ts
uiverify check --static-dir <archive-dir>

With Bun, pass the test files to your runner script: run() runs only those.

bash
bun tests/visual/run.ts tests/visual/checkout.visual.ts
uiverify check --static-dir uiverify-archive

Screenshots: --target is optional

Upload exactly the PNGs you produced (native, mobile, React Native, or any surface we do not render). The upload is inherently scoped to the screens you took, so --target is optional.

bash
uiverify check --screenshots ./screenshots

What do I do when check comes back changed?

Triage it over the UI Verify MCP: check prints the changed-story list and an MCP handoff, so your agent can review the actual pixels rather than eyeballing the diff numbers, bucket real regressions from cosmetic reflow and noise, and accept the baselines you mean to keep. Accepting establishes the branch-scoped preview baseline, so a re-run comes back clean for the change you approved while a fresh change still flags. See Triage visual changes from your coding agent.

Visual testing for agents

UI Verify is visual regression testing for Playwright, Storybook, Vitest and Bun. Your coding agent sees what its UI change did and fixes it before it ships. See how it works.

Get started