# Sketch to UI

> Rough out a card, a section or an icon on top of your running app. GUIJam turns the sketch into real markup and places it in the right component.

Sketch is Draw without a target. Rough out a card, a section or an icon where you want it, and GUIJam turns it into real markup in the component that renders that part of the page. To change an element you already have, [sketch over the component](#sketch-over-a-component) instead.

## Make a sketch

Pick **Draw** and draw anywhere that isn't a loop around an existing element. The stroke becomes a sketch, anchored to the container under it. Keep drawing: more strokes merge into the same sketch until you send it.

Describe what you sketched in the prompt, such as "a pricing card with three tiers", then **Generate**. **Clear sketch** starts over.

## What GUIJam sends

Your AI tool gets two images and the relevant code:

- A screenshot of the page with your strokes on top. GUIJam waits up to 5 s for slow images and other assets before it takes the screenshot.
- The strokes on their own.

Both are scaled to at most 1568 px on the long side. Like any drawing, the result comes back as [three live variants](https://guijam.francistinao.com/docs/guides/draw#compare-three-variants).

## Where new code goes

GUIJam places the new markup in the component that renders the area you sketched over.

A layout is the exception. When the empty area you drew in belongs to a layout around your routed page, such as an app shell whose `<main>` renders `<Outlet />` or `{children}`, the new markup goes in the page next to your sketch, not in the layout. Sketch below your dashboard's content and the card lands in the dashboard's file.

When your project already uses components in React, Preact or Solid, a new self-contained piece, such as a card or a section, goes into one new component file in an `organisms/` folder. Parts are split into `atoms/` and `molecules/` files only when they repeat inside the piece or other UI would reuse them.

A variant can create up to 8 new files, each up to 60 KB, and never overwrites a file that already exists. Undo removes the files a variant created.

## Sketch over a component

Draw on an element you selected to show how it should change, instead of adding new UI next to it:

1. Pick **Select object** and click the element.
2. Click **Sketch what you want for this component** in the fine-tune panel. If the prompt is already open from **Ask AI**, click the pencil button next to the image button instead.
3. Draw over the element. Shapes are parts it should have or its new layout, arrows and circles point at what to change, and crossed-out parts are removed.
4. Describe the change and click **Generate**. Without any strokes, the prompt goes out as a normal request.

Your AI tool gets a screenshot of the page with your strokes and a close-up of the element with your strokes. It changes that element (its classes, text and children) instead of adding a copy, and puts new parts inside it or beside it in the same file. When the element covers almost the whole window, only the page screenshot is sent.

**Clear sketch** removes your strokes and keeps the element and your prompt, so you can draw again. **Cancel** and **Edit prompt** keep your strokes, and the sketch survives a page reload. `Esc` throws the draft away, and Select picks elements again. Starting a sketch reverts any unsaved fine-tune tweaks.

## Requirements

Sketches need an AI tool that can read images:

| AI tool     | Sketches                        |
| ----------- | ------------------------------- |
| Claude Code | Yes                             |
| Codex       | Yes                             |
| OpenCode    | Depends on the model you picked |
| Qwen Code   | No                              |
| Gemini CLI  | No                              |

With a tool that can't read images, GUIJam says so and suggests switching with `npx guijam provider use <id>`.

> **Next.js**
>
> In Next.js, a sketch that would create new component files can't be previewed yet.
