Avalonia’s controls, written as Rust.
An rsx! macro builds the control tree, signals carry the state and closures handle the events. A code-first app needs Cargo and nothing else: the first build downloads a prebuilt Avalonia 12.1 host and checks its SHA-256.
- No .NET SDK to install, and Rust 1.88 or newer
- Windows, macOS and Linux, on x64 and arm64
- Android and the browser too, with iOS and embedded Linux marked experimental
let clicks = scope.signal(0_u32);
scope.mount_view(rsx! {
Window {
title: "Hello from Rust",
StackPanel {
orientation: Orientation::Vertical,
margin: 24.0,
spacing: 12.0,
TextBlock { "Welcome to Avalonia!" }
Button {
class: "primary",
on_click: move |_| clicks.update(|c| *c += 1),
content: fmt!("Clicked {} times", clicks.get())
}
}
}
})?;









