Slint, the declarative GUI toolkit, through C++23 modules: its runtime API, the interpreter and
.slintfiles compiled into modules.
English · 简体中文 · Upstream · Releases · mcpp · Index
The upstream API is unchanged: slint::ComponentHandle, slint::SharedString,
slint::VectorModel, slint::interpreter::ComponentCompiler are the names of
<slint.h>. The SDK is compat.slint 1.19.0 (xim:slint: libslint_cpp, its
headers and slint-compiler, built from the release tag with upstream CMake's
default features). A .slint file is compiled by mcpplibs.mplugin.slint (package
mcpplibs.mplugin.slint, in rules/ of this repository), which the project's build.mcpp
imports; with module set, each file becomes a module the program imports.
import mcpplibs.mwrap.slint;:slint::-- windows and components,SharedString,SharedVector, models,Color,Brush,Image, timers, the event loop,slint::languageimport mcpplibs.mwrap.slint.interpreter;:slint::interpreter--.slintsources loaded at run timeimport mcpplibs.mwrap.slint.platform;:slint::platform-- a custom platform, the software renderer (Clang; with GCC include<slint-platform.h>)import mcpplibs.mwrap.slint.macros;:SLINT_FEATURE_*asconstexpr boolinmcpplibs::mwrap::slint::macrosimport app.ui;: a component of yours, fromui/app.slint(mcpplibs.mplugin.slint,options::module)
More Modules API -> Usage and API
mcpp new counter --template mcpplibs.mwrap.slint@1.19.0
cd counter
mcpp runThe default template opens a window with a counter; without a display (or with
SLINT_HEADLESS=1) it runs on Slint's software renderer and prints the counter.
[dependencies]
mcpplibs.mwrap.slint = "1.19.0.3"// build.mcpp
import mcpp;
import mcpplibs.mplugin.slint;
int main() {
mcpplibs::mplugin::slint::options o;
o.sources = {"ui/app.slint"};
o.module = "app.ui";
return mcpplibs::mplugin::slint::compile(o) ? 0 : 1;
}// src/main.cpp
import mcpplibs.mwrap.slint;
import app.ui;
int main() {
auto ui = AppWindow::create();
ui->on_increase([&] { ui->set_counter(ui->get_counter() + 1); });
ui->run();
}compat.slint 1.19.0 is upstream CMake's default desktop set: interpreter,
backend-winit (X11, Wayland, Windows, macOS), renderer-femtovg (OpenGL),
renderer-software, accessibility, system-tray, testing, and the compiler.
Skia, LinuxKMS, Qt and gettext are not in it. On Linux the library needs
fontconfig (xim:fontconfig) and the C runtime only; X11, Wayland and GL are loaded
when used. mcpplibs::mwrap::slint::macros::SLINT_FEATURE_RENDERER_SKIA and the
others say which features are present.
libglvnd is only a dispatcher: a window on the default OpenGL renderer also needs the
vendor library (Mesa, or NVIDIA's on an NVIDIA X server). compat.slint depends on
compat.glx-runtime (the same package compat.glfw uses) for it, so a project needs
nothing extra; an older descriptor needs compat.glx-runtime = "2026.09.11" in
[dependencies]. If a window still aborts with argument does not name a valid config,
tools/check_display/ shows which part is missing;
SLINT_BACKEND=winit-software runs without GL meanwhile.
Linux, macOS and Windows CI build the modules with GCC and Clang and run the tests:
the runtime types through the module, and a component compiled at run time by
slint::interpreter and driven headless through its properties and callbacks. The
export audit (tools/check_exports.py) reads clang's AST of
the SDK's headers: every public name exported, the key codes and features mapped,
the SDK's features upstream CMake's defaults. A separate job scaffolds the default
template as an installed package, builds it with mcpplibs.mplugin.slint and runs it
headless.
Apache-2.0 for the wrapper, by mcpp-community (NOTICE). Slint is available under the GNU GPLv3, the Slint Royalty-free License 2.0 (desktop, mobile and web; not embedded) or the Slint Commercial License, at your choice (upstream/slint/LICENSE.md, LICENSES). The SDK's own notices, including the Rust crates it links, are deployed with programs.