# Visual AI UI editing for Astro

> Visually edit an Astro 7 site with AI. Fine-tune .astro templates in place, preview live AI variants, and edit React, Vue or Svelte islands.

Edit the UI of your Astro site 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 templates and islands.

GUIJam ships an Astro integration for Astro 7. It maps elements in `.astro` templates to source, and works with the islands you build in React, Vue, Svelte and others.

## Setup

Run `npx guijam@latest init`, or add the integration yourself, first in `integrations`:

```js title="astro.config.mjs" {3,6}
import react from '@astrojs/react';
import { defineConfig } from 'astro/config';
import guijam from 'guijam/astro';

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

The integration only runs under `astro dev`.

## How previews work in Astro

Astro renders `.astro` templates on the server, so GUIJam previews them in two ways:

| Change                        | Preview                                                    |
| ----------------------------- | ---------------------------------------------------------- |
| Fine-tune                     | Changes the page in place, instantly.                      |
| AI variants in `.astro` files | Re-render the page. The panel comes back after the reload. |
| Islands                       | Update live, like in any Vite app.                         |

## Options

`guijam()` from `guijam/astro` takes `root` and `daemonBinary`. `root` defaults to your Astro project root. See the [API reference](https://guijam.francistinao.com/docs/reference/api#guijamastro).
