Visual AI UI editing for Next.js
Edit the UI of your Next.js app by drawing on the running page. GUIJam previews AI variants from Claude Code, Codex or another AI coding CLI live, and writes the one you keep to your components.
GUIJam works in Next.js 16.3 or later with the App Router, on Turbopack or webpack. Previews are live for both client and server components.
Setup#
Run npx guijam@latest init, or wrap your config with withGuijam yourself:
next.config.ts
import { withGuijam } from 'guijam/next';
export default withGuijam({
reactStrictMode: true,
});next.config.js
const { withGuijam } = require('guijam/next');
module.exports = withGuijam({
reactStrictMode: true,
});withGuijam also accepts a config function, (phase, context) => config, the same as Next.js does.
How it works in Next.js#
withGuijam() only does something under next dev. It:
- Adds a loader that marks elements with their source location and serves previews from files it keeps in
.guijam/run/. - Loads the toolbar through
instrumentationClientInject. - Starts a relay on localhost that connects the page to the
gjddaemon, with a per-session token. The relay accepts only localhost origins.
Your source files are never written for a preview.
Options#
export default withGuijam(nextConfig, {
root: process.cwd(),
daemonBinary: '/path/to/gjd',
});Both are optional. See the API reference.
Limits#
- Next.js 16.3 or newer. On older versions,
withGuijamreturns your config unchanged and warns: "[guijam] Next.js<version>is too old for GUIJam. Upgrade Next.js to 16.3 or newer." - App Router only. The Pages Router isn't supported yet.
- New component files. A sketch that would create new component files can't be previewed yet.