slint/api/rs/slint
Olivier Goffart 78a3757b7f
Remormat all the toml file again to fix npm upload
Commit cd6f2e2 reformated the .toml, but the 80 char width column is
judged too small to be practical

Add a .taplo.toml file

Also do not split feature array
2025-04-09 15:06:00 +02:00
..
LICENSES Simplify commercial license (#3063) 2024-05-31 14:06:17 +02:00
tests Auto-fixed clippy::unnecessary_map_or 2025-02-07 09:02:31 +01:00
android.rs Replace no_mangle with unsafe(no_mangle) in example and docs 2025-03-31 17:35:22 +02:00
Cargo.toml Remormat all the toml file again to fix npm upload 2025-04-09 15:06:00 +02:00
compile_fail_tests.rs Simplify commercial license (#3063) 2024-05-31 14:06:17 +02:00
docs.rs Rust docs: have a macro to make link to the Slint doc 2024-12-12 16:44:31 +01:00
lib.rs Bump version number to 1.11.0 2025-03-18 09:48:22 +00:00
mcu.md Don't enable image-default-formats by default, remove compat-1-10 feature 2025-02-22 11:15:18 +01:00
private_unstable_api.rs ChangeLog: Add float.to-fixed and float.to-precision 2025-03-18 11:44:28 +01:00
README.md Update version in docs 2025-02-28 08:19:35 +01: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.10.0"

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