A VS Code extension that serves as a structured AI frontend builder. Sketch layouts visually, describe your intent, and generate production-ready component code.
Features
Visual Layout Builder - Drag and drop boxes to create UI structures with a flexbox-based canvas
AI-Powered Generation - Generate framework-specific component code using OpenAI or Anthropic models
Multi-Page Projects - Create and manage multiple pages within a single project
Shared Components - Create reusable components and track instances across your project
Code Management - Version history, syntax highlighting, and direct export to your workspace
Streaming Generation - Real-time code generation with live preview
Project Persistence - Save and restore project state across VS Code sessions
Installation
Clone this repository
Install dependencies:
npm install
Build the extension:
npm run build
Development
Running in Development Mode
Watch both the extension and webview for changes:
npm run watch
Or run them separately:
npm run dev:extension # Watch extension
npm run dev:webview # Watch webview
Build for Production
npm run build
This builds both the extension and webview bundles.
Usage
Open the Command Palette (Ctrl/Cmd+Shift+P)
Run Lattice: Open
Configure your project settings:
Select your framework (React, Next.js, Vue, Nuxt, Svelte, SvelteKit)
Choose language (TypeScript/JavaScript)
Set UI library (Tailwind, shadcn/ui, MUI, CSS Modules, Styled Components)
Configure AI provider (OpenAI or Anthropic) and API key
Start building:
Drag boxes onto the canvas to create your layout
Add specifications to describe component intent and behavior