# GuiLite — Smallest Header-Only GUI Library for All Platforms > GuiLite is a tiny, header-only C++ GUI library at just 4,000 lines of code. It runs on embedded MCUs, desktop OSes, Docker, and even bare-metal displays with no dependencies. ## Install Save in your project root: # GuiLite — Smallest Header-Only GUI Library for All Platforms ## Quick Use ```cpp // Include the single header #include "GuiLite.h" // Create a surface and render widgets static c_surface* s_surface; static c_display* s_display; ``` ## Introduction GuiLite is a header-only C++ GUI library compressed into roughly 4,000 lines of code. It targets extreme portability, running on microcontrollers, Linux framebuffers, Windows GDI, and Docker containers with no external dependencies. ## What GuiLite Does - Provides basic widgets: buttons, labels, lists, keyboards, and wave displays - Renders directly to raw pixel buffers on any platform - Supports multi-layer compositing for overlapping UI elements - Works on MCUs with as little as 32KB RAM - Enables cross-platform development from embedded to desktop with one codebase ## Architecture Overview GuiLite operates on a simple display-surface-widget model. A display manages one or more surfaces (pixel buffers). Widgets draw themselves onto surfaces using direct pixel manipulation. There is no scene graph or layout engine; positions are set explicitly for maximum control and minimal overhead. ## Self-Hosting & Configuration - Copy the single header file into your project; no build system changes needed - Implement a platform-specific display driver (framebuffer, GDI, or custom) - Set screen resolution and color depth at compile time - Example projects available for STM32, Raspberry Pi, and Windows - Use Docker samples to preview UI without hardware ## Key Features - Entire library fits in one 4K-line header file - Zero external dependencies — no SDL, Qt, or OS-specific APIs required - Runs on ARM Cortex-M, RISC-V, x86, and MIPS architectures - Multi-language support through Unicode rendering - Animation and transition support for responsive UIs ## Comparison with Similar Tools - **LVGL** — richer widget set and theme engine but larger footprint; GuiLite is smaller and simpler - **Dear ImGui** — immediate-mode paradigm for desktop tools; GuiLite targets embedded displays - **Qt for MCUs** — commercial solution with more features; GuiLite is free and dependency-free - **Slint** — modern declarative UI in Rust; GuiLite stays pure C++ header-only ## FAQ **Q: How small is the compiled binary?** A: A minimal GuiLite app compiles to under 10KB on ARM Cortex-M, depending on widget usage. **Q: Does GuiLite support touch input?** A: Yes. It handles touch events and routes them to widgets; you provide the platform-specific touch driver. **Q: Can I use GuiLite for desktop applications?** A: Yes. There are examples for Windows, Linux, and macOS using native display backends. **Q: Is GuiLite suitable for production embedded products?** A: It is used in commercial IoT devices, medical instruments, and industrial panels where minimal resource usage matters. ## Sources - https://github.com/idea4good/GuiLite - https://gitee.com/aspect-studio/aspect-guilite --- Source: https://tokrepo.com/en/workflows/asset-3c98958b Author: AI Open Source