A universal visual editor that works like Elementor or Framer but on any website. Select, drag, resize, and edit UI elements visually or with natural language instructions - AI applies changes intelligently to your codebase.
demo.mp4
Layrr combines visual editing with AI-powered code generation, enabling you to:
- Visual Edit Mode: Drag and resize elements with live preview, commit changes through Claude Code
- Design-to-Code Mode: Upload design images and let Claude generate production-ready components
- Text Edit Mode: Select elements and modify their text content directly in the browser
- Area Selection Mode: Select regions and give natural language instructions for changes
Built with Go, it acts as a reverse proxy between your browser and dev server, injecting a powerful editing interface and integrating seamlessly with Claude Code.
- Drag & Drop: Click and drag elements to reposition them
- Resize Handles: 8-handle resize system (corners + edges) like Figma
- Live Preview: See changes in real-time before committing
- Commit Workflow: Review and apply/discard visual changes
- Framework-Native Output: Claude intelligently updates Tailwind classes, CSS files, or inline styles
- Scroll/Resize Aware: Handles follow elements as you scroll or resize the window
- Design-to-Code: Upload design images β Claude generates production-ready components
- Natural Language Instructions: Select areas and describe changes in plain English
- Context-Aware: Automatically detects your framework (React/Vue/Svelte) and styling (Tailwind/CSS)
- Real-time Streaming: See Claude's thinking and tool usage as it happens
- Beautiful TUI: Bubble Tea terminal interface with live status updates
- Hot Reload: Automatic browser refresh when files change
- Framework Agnostic: Works with any dev server (Vite, webpack, Next.js, etc.)
- Modern UI: Glassmorphism effects, smooth animations, and polished interactions
- Multiple Edit Modes: Visual, Text, Design, and Area Selection modes
- Start your dev server (e.g.,
npm run dev) - Run Layrr:
layrr
- Open your browser at
http://localhost:9999(or your configured proxy port) - Choose an editing mode from the bottom control bar
- Click the cursor icon in the bottom control bar
- Click any element to select it (purple outline + 9 handles appear)
- Drag the center handle to move the element
- Drag corner/edge handles to resize the element
- Make multiple changes (counter shows "[X] changes")
- Click "Apply Changes" to commit β Claude intelligently updates your code
- Or click "Discard" to reset
Keyboard Shortcuts:
Escape- Deselect element
- Click the image upload icon in the bottom control bar
- Upload a design image (screenshot, Figma export, etc.)
- Add context prompt (e.g., "Create a pricing card component")
- Send to Claude β Claude analyzes the design and generates code
- Watch as Claude creates/updates components automatically
- Click the edit icon in the bottom control bar
- Click any text element (paragraph, heading, button, etc.)
- Edit text inline using the popup editor
- Press Enter to send changes to Claude
- Claude updates the code and preserves styling
- Click the selection icon in the bottom control bar
- Drag a rectangle over any UI area
- Enter natural language instructions (e.g., "Make this section responsive")
- Send to Claude β Claude analyzes and implements changes
layrr [options]
Options:
-proxy-port Proxy server port (default: 9999)
-target-port Dev server port (default: auto-detect)
-dir Project directory (default: current directory)
-claude-path Path to Claude Code binary (default: "claude")
-verbose Enable verbose logging# Auto-detect dev server
layrr
# Specify dev server port
layrr -target-port 3000
# Custom proxy port and project directory
layrr -proxy-port 8888 -dir ~/projects/my-app- macOS (Intel or Apple Silicon)
- Claude Code - Install Claude Code
- Running dev server - Any local web server (Vite, webpack, Next.js, etc.)
Note: Go is only required if building from source. The install script downloads pre-built binaries.
curl -fsSL https://layrr.dev/install.sh | bashThis will:
- Auto-detect your architecture (Intel or Apple Silicon)
- Download the latest pre-built binary
- Install to
/usr/local/bin/layrr
If you prefer to build from source:
git clone https://github.com/thetronjohnson/layrr.git
cd layrr
make installRequirements: Go 1.21+ and Make
Layrr uses these Go packages:
- gorilla/websocket - WebSocket connections for browser communication
- fsnotify/fsnotify - File system watching for hot reload
- charmbracelet/bubbletea - Terminal UI framework
- charmbracelet/lipgloss - Terminal styling
- Language: Go 1.21+
- Terminal UI: Bubble Tea + Lipgloss
- WebSockets: Gorilla WebSocket
- File Watching: fsnotify
- Browser UI: Vanilla JavaScript with CSS animations
- Claude Integration: Claude Code CLI with
--output-format stream-json
layrr/
βββ cmd/layrr/ # CLI entry point
β βββ main.go
βββ internal/
β βββ pty/ # Claude Code execution & streaming
β β βββ manager.go
β βββ proxy/ # Reverse proxy & injection
β β βββ server.go
β β βββ inject.js # Browser UI
β β βββ injector.go
β βββ watcher/ # File watching
β β βββ watcher.go
β βββ bridge/ # Browser β Claude messaging
β β βββ bridge.go
β βββ tui/ # Terminal UI
β β βββ model.go
β β βββ view.go
β βββ status/ # Status display
β β βββ display.go
β βββ config/ # Configuration
β βββ config.go
βββ go.mod
βββ Makefile
βββ README.md
# Build the binary
make build
# Install to /usr/local/bin
make install
# Run tests
make test
# Clean build artifacts
make clean
# Run with verbose output
go run cmd/layrr/main.go -verbose
# Build for release
go build -ldflags="-s -w" -o layrr cmd/layrr/main.go- Proxy Server: Intercepts HTTP requests to your dev server
- Script Injection: Injects
inject.js+inject-utils.jsinto all HTML responses - WebSocket Channels: Two-way communication between browser and Go server
- File Watching: Monitors project files for changes
- Hot Reload: Automatic browser refresh when files change
- User selects element β Purple outline + 9 drag handles appear
- User drags/resizes element β Inline styles applied for live preview
- Changes tracked in
pendingChangesMap (non-destructive) - User clicks "Apply Changes" β WebSocket message sent to backend
- Backend analyzes project context (framework, styling approach)
- Context-aware prompt sent to Claude Code
- Claude intelligently updates code (Tailwind classes, CSS files, or inline styles)
- File watcher detects changes β Browser auto-reloads
- User uploads design image + context prompt
- Image + prompt sent to Claude Code with project context
- Claude analyzes design using vision capabilities
- Claude generates production-ready component code
- Claude determines where to place component in codebase
- File changes β Auto-reload
- User selects element/area + provides instruction
- WebSocket message sent with selection details
- Message formatted and sent to Claude Code CLI
- JSONL events parsed and displayed in TUI
- Claude modifies files
- File watcher detects changes β Browser reloads
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0) - see the LICENSE file for details.
The AGPL-3.0 license ensures that:
- You can freely use, modify, and distribute this software
- If you modify and deploy this software on a server, you must make your modified source code available to users
- Any derivative works must also be licensed under AGPL-3.0
Layrr is a universal visual editor that brings design tool capabilities to any web application. Built with Go and powered by Claude, it bridges the gap between visual design and code.