If you are new to VS Code, start here:
- Step-by-step basics: docs/help/getting-started.md
- Static HTML workflow: docs/help/static-html-mode.md
- App Mode workflow: docs/help/app-mode.md
- Common issues: docs/help/troubleshooting.md
- Shortcuts: docs/help/keyboard-shortcuts.md
This file is the “everything in one place” guide.
Live UI Editor lets you click UI elements in a preview, change text/styles/layout visually, and then (when possible) write those changes back into your real project files.
There are two workflows:
- Static HTML Mode (no dev server)
- You open an
.htmlfile. - Live UI Editor previews it.
- Changes are written directly into that same HTML file.
- App Mode (dev server)
- You run your real app (Vite / Next.js / etc.).
- Live UI Editor loads it in a preview and adds an editor overlay.
- Changes are staged as Pending edits, then you click Apply to Code to write them.
- Open your project folder: File → Open Folder…
- Open the Command Palette:
Ctrl+Shift+P - Run: Live UI: Open
- On the Welcome screen, pick a target from Detected main or Other detected targets
- Make a small edit and confirm the underlying file changes
Tip: If you don’t have a running app yet, pick an HTML entrypoint and start with Static HTML Mode.
When you run Live UI: Open, the extension opens a Live UI panel. If nothing is loaded yet, you’ll see a Welcome screen.
Live UI Editor tries to find all reasonable things you could edit in your repo.
- Detected main: the best guess for “what you probably want”.
- Other detected targets: other choices (apps, previews, HTML entrypoints).
This is guidance only; you can pick any target.
Use this if:
- You have a plain website HTML file.
- You don’t have a dev server.
- You want a simple visual editor for HTML.
Buttons you might see:
- Start (pick an HTML file): opens a file picker filtered to
.html/.htm. - Pick an HTML file…: same idea; lets you choose any HTML file.
- Use current file: uses the file currently open in your editor (if it’s a local file).
- Try a sample: loads the bundled sample file (or prompts you if it can’t find it).
Use this if:
- You’re working in a React/Vite/Next project.
- You can run
npm run dev(or similar). - You want to edit your real app UI, not a static snapshot.
Controls you might see:
-
Connect
- Start dev server (integrated terminal): runs the dev server in VS Code’s terminal.
- Use existing URL: you paste a URL (usually
http://127.0.0.1:<port>). - Start dev server (external window): starts it outside VS Code (Windows-friendly option).
-
Style mode (how style edits are written)
- Auto (recommended): picks the best strategy for your project.
- Tailwind: edits Tailwind utility classes where possible.
- CSS Class: writes/updates a CSS class rule in a CSS file.
- Inline: writes inline styles (fast, but can fight responsive CSS).
-
Layout apply (what dragging/resizing writes)
- Off (safest): drag/resize is preview-only.
- Safe: drag moves persist as margin adjustments (more responsive-friendly).
- Full (advanced): drag/resize writes
width/height/transform.
-
Also start backend/API server
- If your app needs a separate backend (auth/API/navigation), enabling this helps start it too.
-
Start App Mode
- Launches App Mode using your selected settings.
-
Help / Troubleshooting
- Opens quick help in the panel and links to this file.
-
Copy Copilot prompt
- Copies a beginner-friendly prompt tailored to your repo. Paste it into VS Code Copilot Chat.
Static HTML mode is a visual editor for HTML files. It does not run your app, and it doesn’t require any framework.
- Run Live UI: Open
- Choose Static HTML / No dev server
- Choose Start (pick an HTML file) (recommended)
When you click, Live UI Editor chooses the element under your cursor using deterministic hit-testing (so the overlay doesn’t “steal” clicks).
There are two selection modes:
- Group: selects a larger container so grouped UI moves together.
- You can also force Group for a single click by holding
Shift.
- You can also force Group for a single click by holding
- Element: selects the specific element you clicked.
- You can force the leaf element (even in Group mode) by holding
Alt.
- You can force the leaf element (even in Group mode) by holding
Other controls:
- Select parent: moves selection up to the parent element.
- Breadcrumbs: shows a short trail so you understand what’s selected.
Once an element is selected:
- Drag the selection overlay to move.
- Drag the resize handles to resize.
Keyboard nudging:
- Arrow keys: nudge by 1px
Shift+ arrow keys: nudge by 10px
What gets written to code:
- Static mode persists edits directly into the HTML file (often as style updates on the selected element).
- Double-click an element to edit its text inline.
Entercommits the edit.Shift+Enterinserts a newline.Escapecancels and restores the original text.- Clicking away (blur) also commits.
Important note:
- Text editing is most reliable when the selected element can be mapped to a clear source location.
App Mode loads your real app (usually running locally) into a VS Code webview iframe, injects an editor overlay, and lets you edit the UI without covering the app.
- A project you can run locally (common: Vite + React, Next.js)
- Node.js installed
- A dev server URL that is reachable in a normal browser
- Start your dev server in the terminal (common):
npm run dev - Run Live UI: Open
- Choose App Mode (dev server)
- Choose a Connect option (integrated / external / existing URL)
- Click Start App Mode
App Mode has two interaction modes:
- Edit: hover/selection overlays, drag/resize, and click-to-code.
- Browse: your app behaves normally (clicks go to the app).
Use the sidebar button:
- Switch to Edit / Switch to Browse
In App Mode, changes are staged first. You’ll see:
- Pending: N (how many changes are staged)
Then:
- Apply to Code: writes all staged edits into source.
- Discard: throws away staged edits.
If identity is not stable, you may see:
- Apply Anyway: forces apply, but it may be less safe.
In the sidebar you’ll see something like:
- Identity: Stable (best)
- Identity: Fallback (works sometimes)
- Identity: Unmapped (cannot reliably map to source)
For best results, click Enable Stable IDs.
What that does:
- Adds a dev-only Babel plugin file in your app root.
- Patches your framework config (Vite/Next) so elements get stable
data-luiidentities. - After you restart the dev server, selection → code edits become much more reliable.
Choose how App Mode writes styles:
- Auto: uses the best available adapter for the repo.
- Tailwind: edits Tailwind utility classes.
- CSS file: writes class rules into a chosen CSS file.
- Use Pick CSS to choose the file.
- Inline: writes inline style props.
Layout apply controls what drag/resize writes to code:
- Off: preview only
- Safe: drag moves persist as margins
- Full: drag/resize writes
width/height/transform
If your repo needs a separate backend server (API/auth/etc.), App Mode provides Start Backend.
It can:
- Detect a likely script (
dev:api,dev:backend,server, etc.) - Or run a custom command
- Remember your choice per app root
App Mode includes viewport presets and overlays to help spot responsive issues.
If your app is a Tauri-targeted UI, enabling Tauri Shim stubs the browser APIs so the UI can load/navigate inside App Mode.
UI Wizard is a VS Code Chat participant named @ui-wizard. It edits the currently selected element.
If UI Wizard says it has no selection:
- Open Live UI Editor.
- If you’re in App Mode, switch to Edit.
- Click the element you want to change.
- Ask
@ui-wizard.
Type one of these in VS Code Chat:
@ui-wizard commands@ui-wizard commands for layout@ui-wizard commands for bulk@ui-wizard commands for structure@ui-wizard commands for images
@ui-wizard width 240@ui-wizard height 48@ui-wizard move right 20@ui-wizard move up 10@ui-wizard x 40 y 12(sets translate)
@ui-wizard suggest 3 modern button styles@ui-wizard preview 1@ui-wizard apply 1@ui-wizard clear preview@ui-wizard undo
@ui-wizard apply 1 to all buttons@ui-wizard apply 2 to all headings@ui-wizard apply 3 to all links@ui-wizard apply this/current style to all text areas
@ui-wizard add a button "Buy now" next to this@ui-wizard add a header "Pricing" above this@ui-wizard add a box inside this@ui-wizard wrap this in a box
@ui-wizard use an image as the background(opens a file picker)
You can ask UI Wizard to redesign an entire page. No element selection is required.
Examples:
@ui-wizard redesign this page as a modern SaaS landing page@ui-wizard give this page a dark theme@ui-wizard restyle the entire layout as a portfolio@ui-wizard turn this into a marketing site@ui-wizard apply a minimalist theme to the whole page
How it works:
- Type a page-level prompt ("redesign", "restyle", "overhaul", "give this page a … theme", etc.).
- CSS streams into the live viewport in real-time (~300 ms flushes) so you can watch the transformation.
- When it finishes, review the result.
- Say
apply(oryes,looks good,ship it) to bake the CSS into your source file. - Say
cancel(orno,revert,undo) to discard and revert.
Tip: You can also describe what kind of site it is for better results — "this is a marketing site, keep all the current features but make it look professional".
For a step-by-step troubleshooting page, see: docs/help/troubleshooting.md
- Make sure you have a folder open (File → Open Folder).
- Check the Output panel: View → Output → Live UI Editor.
- Confirm your dev server URL loads in a normal browser.
- Try Developer: Toggle Developer Tools and check the Console for CSP errors.
- Click Enable Stable IDs.
- Restart the dev server.
- If it still struggles, click Fix targeting.
- Confirm you clicked Apply to Code.
- Ensure the edited file is inside your workspace/app root (guardrail blocks outside edits).
- If using CSS file, click Pick CSS and choose the correct stylesheet.
- Text editing only persists on source-mapped nodes.
- Try double-clicking a more “real” element (often a parent element like a heading, button, or paragraph).
- Toggle the built-in Debug option in the Static HTML toolbar to view rect-update causes.
- If you can reproduce a drift issue, include:
- which mode you were in
- whether the element is inside a scroll container
- whether transforms are involved
This is a quick sanity checklist you can run on any HTML page:
- Select an element → scroll the canvas → overlay stays aligned.
- Select an element inside a nested scroller → scroll nested scroller → overlay stays aligned.
- Resize the VS Code panel → overlay stays aligned.
- Trigger reflow (toggle/hide/show sections) → overlay stays aligned.
- Drag immediately after scroll → no jump.
- In Group mode, click a child → correct container selected → drag/resize affects the container.
- Discord: https://discord.gg/QHnHhCjWDQ