Slint C++ documentation

GitHub CI Build Status GitHub Discussions

Slint is a toolkit to efficiently develop fluid graphical user interfaces for any display: embedded devices and desktop applications. Slint C++ is the C++ API to interact with a Slint UI from C++.

The .slint Markup Language

Slint comes with a markup language that is specifically designed for user interfaces. This language provides a powerful way to describe graphical elements, their placement, and the flow of data through the different states. It is a familiar syntax to describe the hierarchy of elements and property bindings. Here’s the obligatory “Hello World”:

export component HelloWorld inherits Window {
    width: 400px;
    height: 400px;

    Text {
       y: parent.width / 2;
       x: parent.x + 200px;
       text: "Hello, world";
       color: blue;
    }
}

Check out the Slint Language Documentation for more details.

Architecture

An application is composed of the business logic written in C++ and the .slint user interface design markup, which is compiled to native code.

Architecture Overview

Developing

You can create and edit .slint files using our Slint Visual Studio Code Extension, which features syntax highlighting and live design preview.

For a quick edit and preview cycle, you can also use the slint-viewer command line tool, which can be installed using cargo install slint-viewer, if you have Cargo installed.

In the next section you will learn how to install the Slint C++ library and the CMake build system integration.