百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
D

design-playground

> 编程语言
开源

将组件拖动到画布上,并在 Next.js 项目中生成由 AI 提供支持的布局和样式变化。

191 stars0 点赞3 次浏览
访问官网GitHub

工具介绍

将组件拖动到画布上,并在 Next.js 项目中生成由 AI 提供支持的布局和样式变化。

Design Playground

An installable Design Playground for Next.js apps: a local-dev visual canvas at /playground where you drop your app's real components and pages, preview them against mock data, and iterate on them with a local coding agent (Cursor, Claude Code, or Codex — spawned as CLI child processes, no API keys stored in the app).

The playground is vendored into your repo: the installer copies an app/playground/ (or src/app/playground/) folder, wraps next.config when it can, and installs the playground's own dependencies nested inside that folder — your lockfile is never touched.

Extracted from the Humanolab playground so any Next.js App Router app can install the same canvas without Humanolab-specific screens, mocks, or data.

Install

From the root of a Next.js app:

bash
npx design-playground@latest init

(From a clone instead: node /path/to/design-playground/bin/design-playground.mjs init.)

Then start your dev server and open http://localhost:3000/playground.

Other commands:

bash
npx design-playground init --dir src/app/playground   # force src/ layout
npx design-playground@latest update                   # refresh unmodified framework files
npx design-playground update --dry-run

Vite apps: use design-playground-vite.

Requirements

  • Next.js 15+ with App Router (app/ or src/app/)
  • React 19 and react-dom 19
  • Tailwind CSS v4
  • Node.js 20+
  • At least one agent CLI on your PATH for AI features: cursor, claude, or codex

setup.mjs checks the installed versions in your host node_modules. React 18 or Tailwind v3 will refuse to continue.

Not supported: output: 'export' / output: 'standalone' (the playground needs Next route handlers). basePath is supported.

What gets installed

  1. Copies template/ → /app/playground/ (or src/app/playground/).
  2. Wraps next.config with withPlayground() when the file is a common shape (export default nextConfig / module.exports = nextConfig). Unusual configs are left alone; add the wrap yourself from app/playground/next-plugin.cjs.
  3. Appends playground artifact entries to .gitignore.
  4. Runs the nested dependency install (setup.mjs) so nothing lands in your host package.json.

To uninstall, delete app/playground/ (or src/app/playground/). There is nothing to remove from the host lockfile.

The copy is a blank playground: built-in welcome cards, empty discovery registry, no host-app screens. Open Discover to scan this project.

How it works

  1. Discover your project's existing React components
  2. Drag them onto an infinite canvas
  3. Iterate — the agent generates layout and style variations
  4. Compare variations side by side
  5. Use the code you like back in your project

Everything runs locally. Your code stays on your machine.

Repo layout

Path Purpose
bin/design-playground.mjs Zero-dependency installer CLI (init, update)
installer/ Host detection, copy/manifest, next.config patch
template/ The playground itself — copied into hosts
docs/ Install notes

The vendored copy's own docs live at app/playground/README.md after install.

License

Dual regime — see LICENSE.md:

  • bin/, installer/, docs/: MIT.
  • template/ (the playground itself, including the copy vendored into your repo): PolyForm Shield 1.0.0 — free to use in your own products; don't ship a competing playground product with it.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言