Guide · Open source
How to use LVGL: install, build a UI and run the simulator
Updated · written with AI from the project's own documentation and checked against our catalogue data
LVGL is a free, open-source C library for building graphical user interfaces on embedded devices, from small microcontrollers to multi-core Linux-based processors. This guide explains what you need, how to get the code, how to try a UI on a PC before hardware is ready, and how to write a simple button screen. After reading it you will know whether LVGL fits your project and where to go next.
Quick start
- 1Check your requirements. Confirm you have a C compiler toolchain for your board and either Make, CMake or an existing device project. Check your RAM and flash against the figures in the README.
- 2Clone the repository. Run git clone https://github.com/lvgl/lvgl to download the source code.
- 3Run the simulator. Follow the Simulator project guide on lvgl.io to see a UI on your PC before using hardware.
- 4Add LVGL to your project. Include the library in your build with Make, CMake or globbing, and set up your display and input drivers as your board requires.
- 5Create a screen in C. Use lv_obj and widget creation functions such as lv_button_create and lv_label_create on the active screen.
- 6Explore examples. Open the more than 100 examples at lvgl.io/docs/open/examples and adapt one to your device.
What you need before you start
LVGL has no external dependencies, so the main requirement is a way to compile C for your target. The README lists a C compiler toolchain for your board, plus Make or CMake, or an existing project for your device.
For a typical UI, the README says you need about 100kB RAM, 200-300kB flash, and a rendering buffer of 1/10 of the screen size. A bare minimum is listed as 32kB RAM and 128kB flash, so very small memory budgets need care.
- A C compiler toolchain for your target board
- Make or CMake, or an existing project for your device
- Enough RAM and flash for your UI (roughly 100kB RAM and 200-300kB flash for a typical UI)
Get the LVGL source code
The README's install step is to clone the repository. Run the command below in the folder where you want the library to live. Then add the LVGL source to your build, using Make, CMake, or simple globbing, as described in the docs.
git clone https://github.com/lvgl/lvglTry a UI on your PC with the simulator
You do not need hardware to start. The README points to a Simulator project in the LVGL docs, which lets you run a UI in a window on your computer. This is useful for prototyping before your board arrives.
Documentation, examples and the community forum are linked from the project README at lvgl.io and forum.lvgl.io.
- Open the Simulator project guide at lvgl.io/docs/open/integration/pc
- Browse more than 100 C and XML examples at lvgl.io/docs/open/examples
Write your first screen in C
The README shows a simple example: create a button on the active screen, centre it, attach a click callback, and add a label. The callback prints a message when the button is clicked.
Widgets are created with calls such as lv_button_create and lv_label_create, and their properties are set with functions like lv_label_set_text.
static void button_clicked_cb(lv_event_t * e)
{
printf("Clicked\n");
}
/* ... */
lv_obj_t * button = lv_button_create(lv_screen_active());
lv_obj_center(button);
lv_obj_add_event_cb(button, button_clicked_cb,
LV_EVENT_CLICKED, NULL);
lv_obj_t * label = lv_label_create(button);
lv_label_set_text(label, "Hello from LVGL!");Know what the library includes
LVGL ships with more than 30 built-in widgets, including Button, Label, Slider, Chart, Keyboard, Meter, Arc and Table. A style system offers over 100 style properties, and Flexbox- and Grid-like layout engines position widgets responsively.
Input devices include mouse, touchpad, keypad, encoder and external buttons. Text uses UTF-8 and supports CJK, Thai, Hindi, Arabic and Persian. Optional GPU support covers VG-Lite, Dave2D, NeoChrome and OpenGL.
- Widgets: Button, Label, Slider, Chart, Keyboard, Meter, Arc, Table and more
- Layouts: Flexbox and Grid-like engines
- Input: mouse, touchpad, keypad, encoder, external buttons
- Rendering: 2D engine, glTF 3D models via OpenGL, SVG, Lottie
Consider LVGL Pro for faster UI work
LVGL Pro is a separate toolkit with an Editor, Online Viewer, Figma Plugin and CLI Tool. The Editor builds components and screens in XML, and it exports plain LVGL C code with no extra runtime. The README says it is free for non-commercial use and evaluation, and you can try it in the browser at viewer.lvgl.io without installing anything.
The Community and Evaluation tiers are free to use. Check the licensing section of the README for commercial terms.
What people use it for
- Adding a touchscreen menu to an ESP32 or similar microcontroller board
- Building a dashboard with charts and sliders on a device with a display
- Prototyping a device UI on a PC simulator before the hardware is ready
- Creating a UI that runs across chips from different vendors and RTOSes such as Zephyr or NuttX
Frequently asked questions
Is LVGL free to use?
Yes. The README says LVGL is distributed under the MIT license, so it can be used in commercial projects. LVGL Pro is separate, and its Community and Evaluation tiers are free to use.
How do I install LVGL?
The README's install step is to clone the repository with git clone https://github.com/lvgl/lvgl. You then add the source to your build using Make, CMake or simple globbing.
What hardware does LVGL need?
The README says a typical UI needs about 100kB RAM, 200-300kB flash, and a rendering buffer of 1/10 of the screen size. A bare minimum is 32kB RAM and 128kB flash.
Can I try LVGL without a board?
Yes. The README points to a Simulator project in the LVGL docs that runs a UI in a window on your PC. You can also try LVGL Pro in the browser at viewer.lvgl.io.
Does LVGL need a specific language or framework?
The library is written in C and is C++ compatible. The main workflow is writing C code, although LVGL Pro can export C code from XML.
What are alternatives to LVGL?
The project lists TouchGFX, emWin, Qt for MCUs and Slint as comparable projects. Choose based on your chip, licence needs and toolchain.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
LVGL suits engineers and hobbyists who need a full widget set on an embedded display, especially on boards with limited but not tiny memory. It is a poor fit for web or desktop app developers, or for devices with very little RAM, since the README's typical-UI figures are a real constraint.
Install options & downloads