# Visual AI UI editing for Vite apps

> Visually edit a Vite 6, 7 or 8 app with AI. One plugin gives React, Preact, Solid, Vue and Svelte apps live UI variants and source-mapped edits.

Edit the UI of your Vite 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 is a Vite plugin at heart. In a Vite app with React, Preact, Solid, Vue or Svelte, every change previews live through hot reload, and every element maps to the line that rendered it.

## Setup

Run `npx guijam@latest init`, or add the plugin yourself. Put `guijam()` **first** in `plugins`, before your framework's plugin:

**React**

```ts title="vite.config.ts" {3,7}
import tailwindcss from '@tailwindcss/vite';
import react from '@vitejs/plugin-react';
import { guijam } from 'guijam/vite';
import { defineConfig } from 'vite';

export default defineConfig({
  plugins: [guijam(), react(), tailwindcss()],
});
```

**Vue**

```ts title="vite.config.ts" {3,7}
import tailwindcss from '@tailwindcss/vite';
import vue from '@vitejs/plugin-vue';
import { guijam } from 'guijam/vite';
import { defineConfig } from 'vite';

export default defineConfig({
  plugins: [guijam(), vue(), tailwindcss()],
});
```

**Svelte**

```ts title="vite.config.ts" {2,6}
import { svelte } from '@sveltejs/vite-plugin-svelte';
import { guijam } from 'guijam/vite';
import { defineConfig } from 'vite';

export default defineConfig({
  plugins: [guijam(), svelte()],
});
```

**Solid**

```ts title="vite.config.ts" {2,7}
import tailwindcss from '@tailwindcss/vite';
import { guijam } from 'guijam/vite';
import { defineConfig } from 'vite';
import solid from 'vite-plugin-solid';

export default defineConfig({
  plugins: [guijam(), solid(), tailwindcss()],
});
```

**Preact**

```ts title="vite.config.ts" {2,6}
import preact from '@preact/preset-vite';
import { guijam } from 'guijam/vite';
import { defineConfig } from 'vite';

export default defineConfig({
  plugins: [guijam(), preact()],
});
```

When your project has no `vite.config` yet, `init` creates one.

## What maps to source

| UI library    | What GUIJam marks                                                                  |
| ------------- | ---------------------------------------------------------------------------------- |
| React, Preact | JSX elements, including polymorphic components such as `asChild` buttons           |
| Solid         | JSX elements. Fine-tune writes `class` and CSS-named style keys.                   |
| Vue           | Template elements and component usages, with your project's own `vue/compiler-sfc` |
| Svelte        | Regular elements in `.svelte` files. Components aren't marked.                     |

Plain HTML elements outside these libraries render fine, but don't map to source yet.

## Previews

Previews are served from memory through Vite's module graph and hot reload, so your component keeps its state while you switch variants. Your files on disk change only when you **Use** or **Apply**.

## Options

```ts
guijam({
  root: './apps/web',
  daemonBinary: '/path/to/gjd',
});
```

Both are optional. See the [API reference](https://guijam.francistinao.com/docs/reference/api#guijamvite).

## Production builds

The plugin applies only to `vite dev`. Your production build is byte-for-byte the same with or without it.
