Slint — declarative GUI toolkit


<!-- Copyright © SixtyFPS GmbH <> ; SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial --> # Slint [![Component Registry](]( Slint is a declarative GUI toolkit to build native user interfaces for desktop and embedded applications written in Rust, C++, or JavaScript. This component provides the C++ version of [Slint]( for the [Espressif IoT Development Framework]( It has been tested on ESP32-S3 devices. ![Screenshot]( ## Prerequisites In order to compile Slint, you need a working [Rust toolchain for your device]( Follow the instructions from <> to set it up. You can then either set the esp toolchain as the default toolchain with `rustup` or create a `rust-toolchain.toml` file in the root directory of your project with the following contents: ```toml [toolchain] channel = "esp" ``` If you see this error while compiling Slint: ``` error: the `-Z` flag is only accepted on the nightly channel of Cargo, but this is the `stable` channel ``` this means you are not using the right toolchain. ## Usage By using this component, the `Slint::Slint` CMake target is linked to your application and you can access the entire functionality of the [Slint C++ API]( In addition, this component provides the `slint-esp.h` header file, which provides a a function to initialize the Slint backend that must be called before setting up the UI. Behind the scene, it will use `esp_lcd_panel_draw_bitmap` to render to the screen, and is base on [ESP LCD Touch]( for the touch events. Use this platform implementation by instantiating it with a `esp_lcd_panel_handle_t`, an optional `esp_lcd_touch_handle_t`, and a pointer to one or two `slint::platform::Rgb565Pixel` frame buffers. Next, register the instance with the Slint run-time library by calling `slint_esp_init()`: ```cpp #include "slint-esp.h" // ... // Initialize the panel and touch handle esp_lcd_panel_handle_t panel_handle = NULL; bsp_display_new(&bsp_disp_cfg, &panel_handle, &io_handle); bsp_display_backlight_on(); esp_lcd_touch_handle_t touch_handle = NULL; bsp_touch_new(&bsp_touch_cfg, &touch_handle); // Allocate a frame buffer static std::vector<slint::platform::Rgb565Pixel> buffer(BSP_LCD_H_RES * BSP_LCD_V_RES); // initialize the Slint ESP backend slint_esp_init(slint::PhysicalSize({ BSP_LCD_H_RES, BSP_LCD_V_RES }), panel_handle, touch_handle, buffer); ``` Alternatively, you can implement your own sub-class of `slint::platform::Platform` to drive the screen and handle input events. Next, integrate your `.slint` files into the build by compiling them to C++ and linking them to your component: ```cmake slint_target_sources(${COMPONENT_LIB} my_application_ui.slint) ``` Instantiate the Slint component by including the generated header file (`my_application_ui.h` in the above example), call `create()` on the generated class and `run()` to spin the event loop: ```cpp #include "my_application_ui.h" /// ... auto my_application_ui = MainWindow::create(); my_application_ui->run(); ``` ## License You can use Slint under ***any*** of the following licenses, at your choice: 1. [GNU GPLv3](, 2. [Paid license]( See also the [Licensing FAQ]( Slint is also available with a third license (Royalty Free) for desktop applications. ## Links [Website]( · [GitHub]( · [Docs](

Supports all targets

License: Custom

To add this component to your project, run: add-dependency "slint/slint^1.2.0-alpha4"

or download archive


  • espressif/esp_lcd_touch >=1.0.4
  • ESP-IDF >=5.1
  • Stats

    • Downloaded in total
      Downloaded in total 20 times
    • Downloaded this version
      This version: 2 times


    slint/slint version: 1.2.0-alpha4 |