slint/api/rs/slint
Olivier Goffart 44208ff999
Some checks are pending
autofix.ci / format_fix (push) Waiting to run
autofix.ci / lint_typecheck (push) Waiting to run
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, stable) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, 1.88) (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.88) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / material-components (push) Blocked by required conditions
CI / files-changed (push) Waiting to run
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, macos-14, stable) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, 1.88) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, beta) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / cpp_test_driver (macos-14) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / slintpad (push) Blocked by required conditions
CI / wasm_demo (push) Blocked by required conditions
CI / tree-sitter (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
partial_renderer: Don't compute the size with the cache borrowed
Prevent BorrowMut panic if items gets destroyed during rendering

Fixes #9882
2025-10-29 17:09:14 +01:00
..
LICENSES Simplify commercial license (#3063) 2024-05-31 14:06:17 +02:00
tests partial_renderer: Don't compute the size with the cache borrowed 2025-10-29 17:09:14 +01:00
android.rs android: Add support for BackendSelector and require_wgpu_XXX 2025-10-10 16:56:44 +02:00
Cargo.toml Prospective fix for the docs.rs build 2025-10-22 04:57:40 +02:00
compile_fail_tests.rs Simplify commercial license (#3063) 2024-05-31 14:06:17 +02:00
docs.rs ComponentHandle: don't rely on the Inner to be a VRc<ItemTreeVTable> 2025-07-04 10:07:22 +02:00
lib.rs Bump version number to 1.15.0 2025-10-24 14:28:17 +00:00
mcu.md Prepare for release 2025-10-21 10:38:23 +02:00
private_unstable_api.rs Change the Rotate item to a Transform that supports scaling (#9387) 2025-09-15 21:14:33 +12:00
README.md Prepare for release 2025-10-21 10:38:23 +02:00
type-mappings.md Change foo type from i32 to int for Slint's struct 2024-03-04 08:59:32 +01:00

Slint

Crates.io Docs.rs

A Rust UI toolkit

Slint is a Rust based UI toolkit to build native user interfaces on desktop platforms and for embedded devices. This crate provides the Rust APIs to interact with the user interface implemented in Slint.

The complete Rust documentation for Slint can be viewed online at https://slint.rs/docs/rust/slint/.

Getting Started

The crate documentation shows how to use this crate.

Hello World

The most basic "Hello world" application can be achieved with a few lines of code:

In your Cargo.toml add:

[dependencies]
slint = "1.14"

And in your main.rs:

slint::slint!{
    export component HelloWorld {
        Text {
            text: "hello world";
            color: green;
        }
    }
}
fn main() {
    HelloWorld::new().unwrap().run().unwrap();
}

The slint crate documentation contains more advanced examples and alternative ways to use this crate.

To quickly get started, use the Template Repository with the code of a minimal application using Slint as a starting point for your program.

  1. Download and extract the ZIP archive of the Rust Template.
  2. Rename the extracted directory and change into it:
mv slint-rust-template-main my-project
cd my-project

More examples

You can quickly try out the examples by cloning this repo and running them with cargo run

# Runs the "printerdemo" example
cargo run --release --bin printerdemo