UISandbox

io.github.Ideelab由 GitHub 帳號 Ideelab 發布v0.5.3更新於 Oct 29, 2026

Play with your app's design in the browser: load a build, turn the knobs, export the code.

概覽

AI 產生的概覽

把網頁應用載入瀏覽器設計沙箱,讓助理調整 CSS 旋鈕、驗證 1:1 呈現、截圖,並把結果匯出成程式碼。

可以做什麼
  • 依本機位址載入執行中的開發伺服器,或載入已建置應用程式的 zip,並列出其頁面
  • 調整顏色、字體、形狀、間距等設計旋鈕,並讀取目前狀態(含使用者手動調整的值)
  • 在使用者瀏覽器中開啟可互動的沙箱,並等待使用者回傳的調整結果
  • 執行計算樣式的 1:1 驗證,並擷取沙箱畫面的 PNG 截圖
  • 把結果匯出為 CSS、JSON、修補檔、Tailwind、shadcn、Swift 或 Android 設計權杖
適用情境
適合使用者正在調整應用程式視覺設計時使用:在真實應用上試顏色、字體、間距或形狀變更,並排比較不同風格,或把調好的設計系統以修補檔或權杖形式交回給助理。
執行需求
透過 npx uisandbox-mcp 以本機程序執行(需要 Node.js)。verify 與 screenshot 工具需要經 Playwright 安裝 Chromium,其他工具不需要。UISANDBOX_URL 變數決定渲染工具所驅動的應用,預設指向公開網站。載入專案需要執行中的開發伺服器或建置輸出資料夾。
安裝前請注意
open 與 wait_for_send 流程會把控制權交給使用者瀏覽器,並回傳會寫入其原始碼檔案的修補檔,套用前應先檢查。載入公開儲存庫網址時會經由廠商網站抓取,而非完全留在本機。README 說明沙箱框架依設計為同源,並建議部署在獨立網域上。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 UISandbox,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[UISandbox: the editor open on shadcn/ui's Dashboard, the knobs on the left]

UISandbox

Play with your app's design. Right in the browser.
Bring your app, pick a look, tune it, take it home.
Your own app runs 1:1 in the tab, nothing is sent to a server, and closing the tab undoes all of it.

uisandbox.org · npm: uisandbox-mcp · MCP registry · Discussions · MIT

[MIT] [npm]

Your app looks like every other app an AI helped build, and you cannot say why. UISandbox opens it next to the knobs that decide that: colour, type, shape and space. Turn one and every place that value is used follows, on the real app and not a mock-up of it. Keep what you see as a design system your agent can apply.

Open uisandbox.org. It starts on a UI kit, so there is something to turn before you bring anything.

[The four steps on the real app: shadcn/ui's Dashboard, the same screen six ways, Soft picked, the colour turned through five and the dark mode switched, then SB Admin 2 brought in with those knobs, checked 1:1, and the export]

The four steps

  1. Bring your app. The editor opens on shadcn/ui as it ships, six ways, with seven more kits one pick away (Tailwind CSS, daisyUI, Bootstrap, Material 3, Radix Themes, Mantine, Ant Design), each dressed as the same seven-screen invoicing app. Then Try it on your own app: run npx uisandbox-mcp open http://localhost:3000 next to your dev server, or tell your agent to open it, and your running app opens live, every screen, hot reload included. No terminal? Drag Take this screen along to your bookmarks bar and click it on any screen your browser shows (staging, behind a login, a Lovable or v0 preview), or bring a zip, a folder or a public repo. What you turned on the kit comes along if you want it to.
  2. Pick a look. 6 over the screen shows it six ways, side by side: Classic, Compact, Soft, Sharp, Airy and Bold. They differ in corners, spacing, depth and type and never in colour, so you compare the style and not the paint. Open one full size, then Pick this one. The same six are the Preset list.
  3. Tune it. Colour, Type, Shape and Space first; text size, line height, letter spacing, weight, border width, elevation, motion, grey tint and the rest under More. Every dial has ×1 = as in your code at its centre. Your own dark mode is switched on your own hooks. Hold Space to see your original.
  4. Take it home. Copy for your AI puts the design system and how to apply it in one paste, for Claude Code, Cursor, Codex, Lovable or v0. On a kit, the zip keeps a DESIGN.md, a theme.css and a SKILL.md in your repo, written in that kit's own variable names. On your own app you get your files patched in place, or tokens for CSS, Tailwind, shadcn, Swift and Android. With the MCP server running, Send to your agent hands it straight back.

It also says which tells of the generic AI look are on the screen (Inter or Geist everywhere, an indigo brand, gradients as decoration), measured from the page, and which of them a knob fixes.

Open one by link

uisandbox.org/?load= followed by a public GitHub or GitLab repository URL, or a direct link to a .zip that allows CORS, opens straight into the sandbox:

https://uisandbox.org/?load=https://github.com/edwardtufte/tufte-csshttps://uisandbox.org/?load=https://example.com/dist.zip

A repository URL goes through this site's repo route (GitHub and GitLab do not send CORS on archives); a .zip URL is fetched by the browser itself. Either way the archive is read in the tab, exactly as a dropped one is.

It is your app, not a preview of it

Every colour, radius, font, size, spacing, line-height, letter-spacing, weight, border-width, duration, gradient angle and shadow literal in your CSS becomes a variable holding the very same value, so the page renders exactly as it was. Runtime styles too: style="" set by JavaScript, the <style> your framework appends, insertRule and replaceSync from styled-components, Emotion, Lit and Ant's cssinjs, CDN stylesheets through a same-origin proxy, and nested same-origin frames such as Storybook's.

How to check it yourself

  • Check 1:1 loads the untouched and the tokenised page side by side and diffs the computed styles of every element, shadow roots and nested frames included. Zero differences, or it names what differs.
  • The reach meter in the stage foot says how much of what you see the knobs touch, and what lies outside: images, canvas, video.
  • It says so when it can't help. iOS and Android projects, WordPress themes and source without a build get a clear message at the door.
  • A hostile archive cannot navigate the tool away, register its own service worker or unregister ours, or smuggle a zip-slip path out of an export. What it can do, reach the tool's DOM because the frames are same-origin by design, reaches nothing worth having: no server, no credentials, no state. Read notes/security.md, and deploy on an origin of its own.

Your files never leave your browser

There is no server behind the sandbox, no account, no cookies and no analytics. Your files are read in the tab and served to the frame by a service worker on the same origin; exports are made there too. The one exception is a public repo URL, which goes through uisandbox.org to fetch its zip. Nothing is stored.

From your terminal, or from your agent

bash
npx uisandbox-mcp open                       # inside your project: finds the build, opens the sandboxnpx uisandbox-mcp open http://localhost:3000 # your running dev server, live, hot reload included

The same engine runs as an MCP server (mcp/README.md): load a build, a zip or a running dev server, open the real sandbox in the user's browser, wait_for_send for what they turned, set knobs, export any format, verify the 1:1 check and take a screenshot. Add it to any MCP client with npx -y uisandbox-mcp.

Claude Code plugin (skill and server in one): /plugin marketplace add Ideelab/uisandbox, then /plugin install uisandbox@uisandbox, and say "open this app in UISandbox". The skill alone is skills/uisandbox/SKILL.md.

Run it

bash
pnpm installpnpm dev        # http://localhost:5190pnpm test       # vitest, node:test for the audit and the kit enginepnpm build      # dist/: static; public/_headers rides alongpnpm holdouts   # every fixture zip through the real app in headless Chromium (below)

http://localhost:5190/?load=<zip-url> loads a zip by URL (same-origin or CORS).

Test it against real builds

pnpm holdouts runs every archive in fixtures/ (real builds from public repos, gitignored; notes/decisions.md says where each came from) through the app: load, Check 1:1, reach, and a host check. Verdicts are held against scripts/holdouts.expect.json; a fixture expected ok that is not fails the run. --only <name>, --record, --base <url>.

pnpm kits:build builds the eight kit doors from each kit's own package, pnpm kits:gates checks their detection, their export and the live bridge.

How it works

src/  sandbox/    rewrite.ts     their CSS and HTML: literals replaced by var(--us-vN), byte-preserving    table.ts       the substitution sheet: one entry per (kind, value), with its sites    mapping.ts     knob to their values, RELATIVE to the baseline (identity at rest)    baseline.ts    the knobs on the stand of THEIR code    directions.ts  the six looks of Pick a look and Preset    tells.ts       the AI tells, measured on the screen    verify.ts      the 1:1 check: raw against identity, computed styles per element    coverage.ts    the reach meter    live.ts        runtime style="" and <style> get the same rewrite    scheme.ts      their dark mode: the hooks in their CSS, switched  kits/engine/     the kit doors and the design system + skill export, per kit  public/sw.js     serves a sandbox document's URLs from the page; /__ext/ proxies CDN CSS  app/ panel/ tokens/ export/ state/ audit/notes/             decisions (numbered), traps, lessons, security, roadmap

Deploy

One origin, one Cloudflare Worker (worker/index.mjs, wrangler.jsonc): static assets from dist/, the SPA fallback for ?load=, http to https and www to apex, and the /__repo/ route that fetches a public repo's zip (nothing stored, same-origin callers only, rate-limited). public/_headers keeps sw.js uncached and sets the security headers. A deploy is pnpm build && npx wrangler deploy. Put nothing else on the origin: the sandboxed frames are same-origin by design.

Contributing

The most useful thing you can send is a build that does not work. See CONTRIBUTING.md for the 1:1 gate a change to the rewriter is held to, and how to run it against the real builds.

Who made this

I'm Alexander Kaan, and I build open-source tooling for user interfaces. UISandbox came out of the design system generator I made before it: I could hand somebody a finished kit, but I could not show them what their own app would look like in it. This does that other half.

Every decision, and every trap I fell into on the way, is in notes/decisions.md, including the ones I had to undo. Issues and pull requests are welcome.


Made by Alexander Kaan at Ideelab · MIT

來源:README.md,提交 02c8a98

工具

9

load

Load a built web app

Load a web app: a RUNNING dev server by its local address (devUrl, e.g. http://localhost:5173 — live mode: no build needed, hot reload passes through, best while the user is developing), or a BUILT app (a zip of its dist/build/out folder, or a repo zip carrying the build) by URL or local path. Returns the project id, screens, tokenised values and the baseline the knobs stand on. Refuses a build that cannot render (iOS/Android/source-only) with the reason. After a devUrl load, `open` it: the tokenised values and the knobs arrive in the browser as the app renders.

輸入參數devUrlzipUrlzipPath

screens

List screens

The screens (HTML entries) of a loaded project.

輸入參數id必填

set

Turn the knobs

Apply knobs to a loaded project. Every dial has ×1 (or 0) = as in their code; colours are #rrggbb. Returns what moved (count and a sample of value → value).

輸入參數id必填knobs必填

export

Export

Export the current state: sheet-css (your values as CSS custom properties), sheet-json, patch (literal → value list), tokens-css / tokens-json / tailwind / shadcn (the --k-* design tokens), swift, android-xml, android-kotlin.

輸入參數id必填format必填

open

Open the sandbox

Open UISandbox in the user's browser with this project loaded — the real, interactive sandbox: the whole app rendered 1:1, every knob there to turn by hand. Use this whenever the user wants to SEE or PLAY with the design themselves ("can I look at this in a sandbox", "let me try some changes"), not only read numbers. Served from 127.0.0.1 by this process; nothing leaves the machine. What the user turns in the browser flows back here: a later `export`, `verify` or `screenshot` uses it.

輸入參數id必填carryscreen

state

Current knobs

The knobs as they stand now — including what the user turned by hand in an opened sandbox (and when).

輸入參數id必填

wait_for_send

Wait for the user to send it back

After `open`: wait until the user presses "Send to your agent" in the sandbox, then return what they turned (from → to, in the panel's own names), how many values moved, and the patch that writes it into their source. Returns at once if they already sent and you have not collected it. If the time runs out first it says the sandbox is still open: call it again (or ask them).

輸入參數id必填timeoutSeconds

verify

Check 1:1

Run the 1:1 check in a real browser: the untouched build vs. the tokenised build with the identity sheet, computed styles of every element diffed. Also returns the reach meter. This is the same check a visitor runs on uisandbox.org.

輸入參數id必填widthscreen

screenshot

Screenshot

A PNG of the screen as it renders with the current knobs (the sandbox frame only).

輸入參數id必填widthscreen

版本歷史

4
  1. v0.5.3最新Oct 21, 2026
  2. v0.5.0Oct 19, 2026
  3. v0.4.0Oct 19, 2026
  4. v0.3.3Sep 16, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分