Live UI Editor
Visual React/Vite editing inside VS Code — drag, resize, rotate, and edit text with live source code updates.
Features •
Quick Start •
How It Works •
Docs •
Contributing
✨ Features
🎯 Click to Code
Click any element in your running app and instantly jump to its source location in your editor.
|
🖱️ Drag & Resize
Move and resize elements visually. Changes write directly to your JSX/TSX source files.
|
✏️ Inline Text Editing
Double-click any text to edit it inline. Supports i18n — automatically updates your translation JSON files.
|
🗑️ Delete Elements
Remove JSX elements from source with a single click. Fully undoable with Ctrl+Z.
|
🔄 Live Preview
See changes instantly in the embedded browser. Toggle between Edit and Browse modes.
|
📦 Safe Staging
All changes are previewed before saving. Apply or discard pending edits with one click.
|
🚀 Quick Start
Installation
From VS Code Marketplace:
- Open VS Code
- Press
Ctrl+Shift+X to open Extensions
- Search for "Live UI Editor"
- Click Install
Or install via command line:
code --install-extension TheImmersiveSaga.vscode-live-ui-editor
First Launch
- Open your React/Vite project in VS Code
- Press
Ctrl+Shift+P → type "Live UI: Open (App Mode)"
- Start editing — click, drag, resize, or double-click text
That's it! Your changes are staged and ready to apply.
🎮 Controls
| Action |
Shortcut |
| Select element |
Click |
| Jump to source |
Ctrl+Click |
| Multi-select |
Shift+Click or Shift+Drag |
| Select leaf element |
Alt+Click |
| Move element |
Drag selection |
| Resize element |
Drag corner handle |
| Edit text |
Double-click |
| Delete element |
Click 🗑️ button |
| Apply changes |
Click Apply to Code |
| Discard changes |
Click Discard |
🔧 How It Works
┌─────────────────────────────────────────────────────────────┐
│ VS Code │
│ ┌─────────────────┐ ┌─────────────────────────────────┐ │
│ │ Your Source │◄───│ Live UI Editor │ │
│ │ Files │ │ ┌───────────────────────────┐ │ │
│ │ (JSX/TSX) │ │ │ Your Vite App (iframe) │ │ │
│ └─────────────────┘ │ │ │ │ │
│ │ │ │ [Visual editing here] │ │ │
│ ▼ │ │ │ │ │
│ ┌─────────────────┐ │ └───────────────────────────┘ │ │
│ │ AST Parser │ │ │ │ │
│ │ (ts-morph) │ │ ▼ │ │
│ └─────────────────┘ │ Pending edits staged │ │
│ │ Click "Apply to Code" │ │
│ └─────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
- Proxy Server — Routes your Vite dev server through VS Code
- Injected Script — Adds selection, dragging, and editing UI to your app
- React Fiber Inspection — Maps DOM elements back to source code locations
- AST Modification — Uses ts-morph to surgically edit your source files
📖 Documentation
Editing Modes
| Mode |
Description |
| Edit |
Visual editing enabled — click to select, drag to move |
| Browse |
Normal app interaction — click events pass through |
Toggle with the Switch to Browse/Edit button in the toolbar.
Layout Apply
By default, layout changes (drag/resize) are preview only.
- OFF (default): See visual changes, but they won't save to code
- ON: Drag/resize writes
width, height, transform to source
Enable via the checkbox in the toolbar when you want to commit layout changes.
Stable IDs (Recommended)
For reliable element targeting, enable Stable IDs:
- Click Enable Stable IDs in the toolbar
- The extension injects
data-lui attributes via a Babel plugin
- Restart your dev server
This ensures elements are uniquely identifiable even after HMR updates.
i18n Support
The extension auto-detects {t('translation.key')} patterns:
- Text edits update your
src/locales/*.json files
- The JSX source stays unchanged
- Supports nested keys like
common.buttons.save
📋 Requirements
| Requirement |
Version |
| VS Code |
1.85.0+ |
| Node.js |
18+ |
| Project |
Vite + React |
Framework Support
| Framework |
Status |
| Vite + React |
✅ Full support |
| Vite + React + TS |
✅ Full support |
| Create React App |
⚠️ Limited (no proxy) |
| Next.js |
🧪 Experimental |
| Vue/Svelte |
🚧 Planned |
🐛 Troubleshooting
Buttons not responding in App Mode
Reload the VS Code window (Ctrl+Shift+P → "Reload Window") and restart App Mode.
Changes applied to wrong element
Enable Stable IDs for reliable targeting. Without them, elements are matched by heuristics which can fail after HMR updates.
Dev server won't start
- Ensure your
package.json has a dev script
- Check that port 5173 is available
- Try starting the server manually first, then use App Mode
i18n text edit failed
- Translation files must be in
src/locales/*.json
- The translation key must exist in the JSON file
- Check Output panel: View → Output → Live UI Editor
🤝 Contributing
Contributions are welcome! Here's how:
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/VSC-Live-UI-Editor.git
- Install dependencies:
npm install && cd webview-ui && npm install
- Build:
npm run build
- Test in VS Code: Press
F5 to launch Extension Development Host
- Submit a pull request
Development Scripts
npm run build # Build extension + webview
npm run watch:extension # Watch mode for extension
npm run build:webview # Build webview UI only
📄 License
MIT License — see LICENSE for details.
🔗 Links
Made with ❤️ by ChaosTimTom
Visual editing for developers who want to see their changes instantly.