Toolbox · Runnable code preview

Live React sandbox check

Code that looks right in a chat window has not been run. This compiles AI-generated React and mounts it in the page, so a missing import, an undefined prop at first render or a hook called inside a condition stops being a theory and becomes an error you can read.

@codesandbox/sandpack-reactLive sandboxCode compiles in CodeSandbox

Twenty-five instruments on one bench.

Live tool

Live sandbox · the code is compiled in CodeSandbox

Loading the live sandbox…

Running it is the only proof

Generated React usually looks plausible: imports that read correctly, hooks in a sensible order, a component that returns something. None of that is evidence. The failures that matter only exist at runtime — an import path that does not resolve, a prop that arrives undefined because nothing passed it, a hook placed after an early return.

A live mount turns each of those into a message. That is the whole argument for running the code rather than reading it: the browser is the only reviewer that cannot be persuaded by confident syntax.

Read the console, not the preview

A blank preview has three plausible causes — a compile error, a runtime exception, or a component that legitimately renders nothing — and the console distinguishes them. Switch to the broken preset to see what a first-render failure looks like: the preview shows the overlay and the console names the line.

Warnings are worth reading too. A missing key, a state update during render or a dependency array that changes every render will not stop the component mounting now, and all three will misbehave once real data arrives.

What a sandbox cannot cover

The sandbox has no real props, no authenticated user, no API and no server data. A clean run proves the component compiles and survives its own default state, not that the feature works. Logic, data handling and anything security-adjacent still belong to the console and a human reviewer.

And unlike the rest of the toolbox, this tool is not offline: Sandpack sends the files to CodeSandbox's bundler to compile and run them. Never paste secrets, customer data or private source you would not hand to a third party.

Questions about this tool

Does my code leave the browser?
Yes — this is the one tool here that is not offline. Sandpack sends the files to CodeSandbox's bundler to compile and run them. Keep secrets and customer data out of it.
Can I edit the code in the sandbox?
Yes. The editor is live, and the preview recompiles after each change, so you can correct the model's output and see the fix immediately.
Does a clean run mean the component is correct?
No. It means it compiles and mounts without an error. Correct behaviour with real data, and anything involving security or money, needs the verification console and a reviewer.

Toolbox

Fix the prose here, then check what the prose cannot show.

The console runs structural, claim and formatting checks on the same draft, and a named reviewer takes on anything with consequences.