# Visual Builder

> **Live now:** the ChainRender Visual Builder is at **[chainrender.org/builder](https://chainrender.org/builder)** — compose, grade, theme, and deploy on-chain apps in the browser, no install required.

ChainRender is designed to support a **visual builder** — a graphical canvas where developers compose apps by
dragging, arranging, and configuring components instead of writing code. This page explains the vision, what
already exists to make it possible, and its current status.

## The vision

A visual builder would let a developer:
- **Drag components** (buttons, charts, tables, images, scenes) onto a canvas from the vocabulary.
- **Bind data** by picking a resolver from a list, not writing an ABI call.
- **See the live grade** update as they build — add an off-chain image and watch the grade drop from A to C, with
  the reason shown inline.
- **Preview the render** in real time (the on-chain output, exactly as it will appear).
- **Theme visually** — adjust tokens with color pickers and sliders, at zero gas (presentation is render-time).
- **Export** the composition to deploy — a content-addressed, graded, validated app.

In short: the full compose → grade → compile → validate loop, but graphical.

## Why the foundation already exists

The visual builder isn't a separate product to invent — it's a **client of the SDK that's already shipped.** The
SDK was architected for exactly this:

- **The vocabulary is machine-readable.** `vocabulary()` returns every node type, capability, and resolver kind —
  so a builder can populate its component palette *automatically*, and a new component added to ChainRender appears
  in the builder with no builder code change (the SDK spec guarantees this: additions "propagate to the SDK,
  builder, MCP tools, and AI vocabulary with no code change").
- **Grading is instant and drift-locked.** `grade()` gives the builder a live trust badge that matches the chain.
- **Compiling is deterministic.** The builder's output is a reproducible hash.
- **The compositor is builder-friendly by design.** The on-chain compositor's socket/anchor model ("anchor to a
  declared point on the scene") was explicitly designed as "the piece most worth carrying into a builder/canvas" —
  placement is semantic, declarative data, not layout code.

So a visual builder sits on the same foundation as the **[MCP server](../reference/mcp-and-skill.md)** (which gives
*AI* tool access to that foundation) — the builder gives *humans* graphical access to it. Same SDK, same
verifiable loop, different interface.

## Current status

- **The foundation** (SDK, `vocabulary()`, `grade()`, deterministic compile, the builder-friendly compositor) —
  **shipped.**
- **The visual builder UI itself** — **LIVE at [chainrender.org/builder](https://chainrender.org/builder).** A
  schema-driven canvas: drag components, bind live on-chain data (ENS, Chainlink, NFT media, p5/three), watch the
  trust grade update live, theme visually, and connect a wallet to deploy + render on-chain — all from the browser.

The builder sits on the shipped SDK: it bundles `vocabulary()`, `grade()`, and `compileComponent()` in-browser,
so everything it does is verifiable — the same grade/compile the chain computes, live as you build.

## What the builder does for you

- **Classic or Enhanced.** The **Mode** picker in the top bar chooses the output: **Classic** (VERSION_2–4, every
  chain) or **Enhanced (V5)** (layout and type tokens, hints, `lang`/`dir`, heading levels and more roles — see
  **[Style Tokens](../reference/style-tokens.md)**). Enhanced is offered only where the selected chain's
  `RenderRouter` has the VERSION_5 interpreter, and Deploy refuses an Enhanced project on any other chain.
- **The right registry.** On chain selection the builder reads `RenderRouter.registry()` and deploys there — on
  Sepolia `ComponentRegistry`, on Robinhood and Arc `ComponentRegistryFast`. Deploy waits while that read is pending
  and refuses if it failed or the Registry field disagrees, because bytes in another registry deploy but never render.
- **No paying twice.** Before each write it checks `exists()`: bytes already on-chain are skipped at no gas, so a
  wallet warning about `AlreadyRegistered` (`0x77caf672`) never has to be sent.
- **History.** Every compile and deploy is kept with its full hash, a **Copy** button and an **Open in viewer** link.
- **Fork.** `builder/?fork=<hash>&chain=<id>` (or **⑂ Fork in builder** in Explore) reads a deployed component's
  bytes from the registry the router renders from, opens them with `decompile()` (client 0.21.0) and checks they
  compile back to the same hash before loading anything; a VERSION_5 app opens in Enhanced mode. Unchanged, it
  compiles to the hash it came from; any edit deploys as a new app with a new hash, and the original stays on chain.
  A hash the registry does not hold, bytes that do not match their hash, a malformed hash or an unknown chain are
  refused and load nothing. Compositions and rich-media scenes cannot be forked here; they open in the viewer. Bound
  slots keep their deployed resolver and encoded argument (the builder's friendly argument fields are not in the
  bytes).
- **✦ AI, with your own key.** Describe an app and the builder asks the model you pick (OpenAI, Gemini, Ollama or
  Claude), then grades and validates the reply before it touches the canvas. For Claude, an **Effort** setting
  (low / medium / high; medium by default, remembered in your browser) sets how much it thinks before writing. Thinking
  counts toward the reply's 64,000-token budget, so if Claude spends it all thinking, the builder retries once a level
  lower and says so. Replies stream, so the panel shows progress. Your key stays in the page for the session and goes
  only to the provider.
- **Submit.** Names the app under `chainrender.eth` with a refundable stake, which lists it in Explore — see
  **[Submitting to the Catalog](../guides/submitting.md)**.

## Ways to build

You have four ways to build a ChainRender app:

- **The visual builder** at **[chainrender.org/builder](https://chainrender.org/builder)** — compose visually,
  grade + validate live, connect a wallet, and deploy on-chain. No install.
- **Code** with `@chainrender/client` (`compose.*` builders) — see **[Quick Start](../getting-started/quick-start.md)**.
- **AI** via the MCP server or the app-builder skill — see **[Building with AI](../guides/building-with-ai.md)**.
- **Scaffold** a working project with `create-chainrender` — see **[Scaffolding](../getting-started/scaffolding.md)**.

All four produce the same graded, content-addressed, verifiable apps.

## Related
- **[MCP Server & AI Skill](../reference/mcp-and-skill.md)** — the AI-facing client of the same foundation.
- **[The Vocabulary](../reference/vocabulary.md)** — what a builder's palette derives from.
- **[Building with AI](../guides/building-with-ai.md)** — the AI/MCP path to the same foundation.
