Better_Software_Header_Mobile Better_Software_Header_Web

Find what you need - explore our website and developer resources

Building Reusable Slint UI Libraries with Rust Crates

fn main() {
    let config = slint_build::CompilerConfiguration::new().as_library("MyLibrary").rust_module("mymodule");
    slint_build::compile_with_config("mylib.slint", config);
}
[dependencies]
my-library = { ... }
import { Foo } from "@MyLibrary"
DEP_MYLIBRARY_SLINT_LIBRARY_MODULE=mymodule
DEP_MYLIBRARY_SLINT_LIBRARY_NAME=MyLibrary
DEP_MYLIBRARY_SLINT_LIBRARY_PACKAGE=my-library
DEP_MYLIBRARY_SLINT_LIBRARY_SOURCE=/absolute/path/to/mylibrary.slint
export global MyAppData {
    in property <int> some-value: 42;
    callback update-data();
}

Tags:

rustslint

About KDAB

Benny_Sjöstrand

Benny Sjöstrand

Senior Software Engineer

Sign up for the KDAB Newsletter

Learn Rust

Learn more