LVGL Studio AI is a professional, browser-based visual interface designer for embedded systems. It empowers developers to visually build complex Multi-Screen GUIs for the Light and Versatile Graphics Library (LVGL) using a drag-and-drop interface, and instantly generate production-ready C or MicroPython code using Google's Gemini AI, Anthropic Claude, OpenAI, DeepSeek, or Local LLMs.
- Preview Mode π
βΆοΈ : Instantly switch to an interactive preview to test widget states (buttons, switches, inputs) and screen traversal (navigation events) without leaving the editor. - Canvas Zoom ππ: Zoom in and out (
Alt + Scroll) to work on fine details or view the entire project map. - AI Widget Generator π§ : Create widgets instantly by describing them in plain English.
- Smart Alignment π: Magnetic guidelines snap widgets to edges and centers.
- Multi-Screen Support: Create and visually link multiple screens.
- Time Travel & History:
- Undo/Redo: Full state history support (Ctrl+Z / Ctrl+Y).
- History Menu: View a timeline of your actions.
- Project Persistence:
- Auto-Save: Automatic LocalStorage persistence.
- Import/Export: Save your projects to
.jsonfiles and share them or load them later.
- Template Library: Jumpstart development with high-fidelity, pre-configured templates (Thermostats, Dashboards, Audio Players).
- Global Theming: Instantly style your entire project with presets like Cyberpunk, Midnight, Retro, and more.
- Event System: Define logic for Clicked, Pressed, Released, and Value Changed events. Support for Navigation actions or Custom C/Python code.
- Visual Drag-and-Drop Editor: Intuitive canvas to place and arrange UI elements with snapping.
- Layer Management: Create, lock, hide, and reorder layers via drag-and-drop to manage complex composite UIs.
- Image Uploads: Upload images to preview them on the canvas and generate correct file-reference code.
- Multi-Provider AI: Generate code using Gemini (Flash/Pro), DeepSeek V3/R1, Claude 3.5, GPT-4o, or local models (Ollama).
- Live Properties: Real-time editing of dimensions, colors, borders, shadows, and logic.
- Advanced Widget Properties π: Support for LVGL Flags (Checkable, Floating, Scroll Momentum, etc.) and deep styling options like Shadow Spread.
- WSIWYG Rendering π¨: High-fidelity WYSWIYG rendering engine with visible overflows, exact border placement, and glitch-free resize handles.
LVGL Studio AI includes preset resolutions for a wide range of popular embedded displays and development boards.
- Core / Core2 / Basic (320x240)
- M5Paper (960x540)
- Cardputer / StickC Plus (240x135)
- M5Dial (240x240 Round)
- T-Display S3 (320x170)
- T-Deck (320x240)
- T-HMI (320x240)
- ESP32-S3 4.3" (800x480)
- ESP32-S3 5.0" (800x480)
- ESP32-S3 7.0" (800x480)
- CrowPanel 5.0" (800x480)
- CrowPanel 7.0" (800x480)
- 5.0" STM32 Embedded (800x480)
- 7.0" STM32 Embedded (1024x600)
- 10.1" STM32 Embedded (1280x800)
- 3.5" IPS LCD (480x320)
- 4.3" / 5.0" / 7.0" HDMI (800x480 - 1024x600)
- 1.28" Round Touch (240x240)
- PyPortal / Titano
- TFT FeatherWings (2.4", 3.5")
- 1.28" Round IPS
To run the application locally, you need Node.js installed.
-
Clone the repository.
git clone https://github.com/yourusername/lvgl-studio-ai.git cd lvgl-studio-ai -
Install Dependencies:
npm install
-
Start Development Server:
npm run dev
-
Open in Browser: Navigate to
http://localhost:5173.
To use Gemini API, create a .env file in the root directory:
API_KEY=your_google_gemini_api_key
graph TD
User([User Interaction]) -->|Drag & Drop / Keyboard| State[App State Store]
User -->|Undo / Redo| History[History Stack]
History --> State
State -->|Auto-Save| LocalStorage[Local Storage]
State -->|Export JSON| File[Project File .json]
State -->|Context Data| AIService{AI Service}
AIService -->|Cloud| Gemini[Google Gemini]
AIService -->|Cloud| DeepSeek[DeepSeek V3/R1]
AIService -->|Cloud| Claude[Anthropic Claude]
AIService -->|Cloud| OpenAI[OpenAI GPT-4]
AIService -->|Local| Ollama[Local LLM / Ollama]
Gemini --> Generator[Code Generator]
DeepSeek --> Generator
Claude --> Generator
OpenAI --> Generator
Ollama --> Generator
Generator -->|Export| CFile[ui.c / LVGL C]
Generator -->|Export| PyFile[ui.py / MicroPython]
- Auto-Save: The app automatically saves your workspace state (screens, widgets, settings, AI config) to your browser's Local Storage.
- Save Project: Click the Save (Download) icon in the header to download a
.jsonfile containing your entire project. - Open Project: Click the Open (Folder) icon to upload a previously saved
.jsonfile. This will overwrite your current workspace.
- Add Screen: Go to the Screens tab in the left sidebar and click
+. - Switching: Click a screen name in the list to edit it.
- Linking: Select a Button or Icon, go to Properties > Events, add an event, set Action to
NAVIGATE, and select the target screen.
Widgets support a robust event system. In the Properties Panel:
- Click Add Event.
- Select Trigger (e.g.,
CLICKED,VALUE_CHANGED). - Select Action:
- NAVIGATE: Switches screens using
lv_scr_load_anim. - CUSTOM CODE: Injects raw C or Python code (e.g.,
printf("Hello");orled.on()).
- NAVIGATE: Switches screens using
- Widgets with events display a small yellow "Zap" badge on the canvas.
- In the Widgets sidebar, look for the "AI Generator" input at the top.
- Type a description like "A large red stop button with round corners" or "Blue WiFi icon".
- Press Enter. The AI will construct the widget JSON and add it to your canvas automatically.
- Add an Image Widget.
- In the Properties Panel, click Upload Image.
- The image is Base64 encoded for the browser preview.
- The generated code will reference the filename (e.g.,
lv_img_set_src(ui_img, "S:my_image.png")).
Click the Settings Icon in the top header to configure your AI provider.
- Google Gemini: Default. Supports Google AI Studio account integration (via "Connect Google Account") to access Gemini 3.0 Pro and Thinking models with higher limits.
- DeepSeek: Enter your API key. Supports DeepSeek V3 and R1 (Reasoner).
- Anthropic Claude: Enter your API key to generate high-quality code using Claude 3.5 Sonnet or Opus.
- OpenAI: Requires
sk-...key. - Local LLM: Connect to local endpoints (e.g., Ollama at
http://localhost:11434/v1).
- Design your UI.
- Select your Target Device (e.g., M5Stack Core2) in Global Settings for optimized resolution.
- Click Generate Code.
- The AI receives a structured JSON payload describing all screens, widgets, themes, and events.
- It produces fully functional C (LVGL v8/v9) or MicroPython code.
| Widget | Icon | Configurable Properties |
|---|---|---|
| Button | βΉοΈ | Text, Color, Radius, Gradient sheen |
| Label | π€ | Text content, Font size, Text Color |
| Slider | ποΈ | Value, Min/Max, Colors. Auto-vertical orientation if H > W. |
| Switch | π | Checked state, Pill styling, Animation timing |
| Checkbox | βοΈ | Label text, Checked state |
| Arc | β | Value, Range, Track/Indicator colors, Thickness |
| Container | π¦ | Background (Solid/Transparent), Borders, Radius |
| Text Area | π | Placeholder, Text, Cursor blink simulation |
| Chart | π | Line vs Bar mode, Data points simulation, Grid lines |
| Image | πΌοΈ | Source path/upload, Placeholder visualization |
| Icon | β | Built-in LVGL Symbols (Home, Wifi, Battery, etc.) |
| Bar | π | Similar to slider but for display only |
| Roller | π | Scrollable option selector |
| Dropdown | π½ | Collapsible list |
| LED | π‘ | Circular indicator with gloss effect |
| Keyboard | β¨οΈ | Visual keyboard placeholder |
This project is open-source under the MIT License. Generated code belongs to the user.