edit your next.js app right in the browser.

nextcanvas turns your locally-running app into an editable canvas. double-click any text, type a new value, and it is written straight back into your source file. fast refresh does the rest.

a ready-to-paste prompt for claude code, cursor, or codex

star on github

fyi, this entire page is a live demo running the real overlay. flip the switch in the toolbar, then double-click any text. changes stay in your browser — reload to reset.

integration

two commands. nothing to wire by hand.

install it, run one command, and start editing. init wraps your next.config and mounts the overlay for you.

1

install the package

add it as a dev dependency. it ships prebuilt, so there is no build step on your end.

2

run npx nextcanvas init

it wraps your next.config with withCanvas and mounts the overlay in your root layout. then run next dev.

terminal
$ npm i -D @rishi-thak/nextcanvas
$ npx nextcanvas init
✓ wrapped next.config.ts with withCanvas
✓ mounted <NextCanvasOverlay/> in app/layout.tsx
→ run `next dev` and double-click any text
next.config.ts
// wired for you by `npx nextcanvas init`
import { withCanvas } from '@rishi-thak/nextcanvas/next';

export default withCanvas(nextConfig);

how it works

from double-click to source edit.

a compile-time stamp maps every element back to its exact line of source. the rest is a single round-trip.

01 · click

double-click text in the browser. the overlay reads the element data-loc stamp.

02 · post

it posts the file, line, old and new text to the local write-back server.

03 · write

ts-morph does a formatting-preserving ast edit and saves your source file.

04 · refresh

next.js fast refresh re-renders instantly. no websocket, no reload.

features

everything you need, nothing you do not.

double-click to edit

any static text becomes editable inline. no side panels, no edit mode to toggle — just click and type.

💾

written back to source

edits land in your real .tsx file through a formatting-preserving ast edit. your code and style are untouched.

fast refresh, instantly

edits are one-way posts; the browser update comes for free from next.js fast refresh. no socket to maintain.

🦀

swc plugin, both bundlers

the source stamp runs inside swc, so webpack and turbopack both work. zero extra config, next/font intact.

🌙

dev-only, zero prod cost

everything is gated to development and compiles out completely in production builds. ship with confidence.

🧩

robust across react

elements are mapped to source at compile time, not from fragile react internals. it just keeps working.

drop it into your next.js app.

install once, edit forever. nextcanvas is a dev dependency that stays out of your way and out of production.