Getting Started

This tutorial uses Rust as the host programming language. Slint also supports other programming languages like C++ or JavaScript.

We recommend using rust-analyzer and our editor integrations for Slint for following this tutorial.

Slint has an application template you can use to create a project with dependencies already set up that follows recommended best practices.

Before using the template, install [cargo-generate](https://github.com/cargo-generate/cargo-generate):

cargo install cargo-generate

Use the template to create a new project with the following command:

cargo generate --git https://github.com/slint-ui/slint-rust-template --name memory
cd memory

Replace the contents of src/main.rs with the following:

fn main() {
    MainWindow::new().unwrap().run().unwrap();
}

slint::slint! {
    export component MainWindow inherits Window {
        Text {
            text: "hello world";
            color: green;
        }
    }
}

Run the example with cargo run and a window appears with the green "Hello World" greeting.

Screenshot of an initial tutorial app showing Hello World