Info
This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: WaterUI: A SwiftUI-inspired cross-platform UI framework for Rust with cross-platform native rendering
I wanted SwiftUI's declarative style and type safety, but for all platforms. So I built WaterUI - a Rust UI framework that gives you the best of both worlds.
I love SwiftUI's approach - declarative, type-safe, with a modern API. But existing cross-platform solutions all have trade-offs:
Features:
use waterui::prelude::*;
pub fn counter() -> impl View {
let count = Binding::int(0);
let doubled = count.map(|n| n * 2);
vstack((
text!("Count: {count}"),
text!("Doubled: {doubled}")
.font_size(20)
.foreground_color(Color::gray()),
hstack((
button("Increment")
.action_with(&count,|count| count.increment(1)),
button("Reset")
.action_with(&count,|count| count.set(0))
.foreground_color(Color::red()),
))
.spacing(10),
))
.padding(20)
.spacing(15)
}
The framework is in alpha but actively developed. Core features working:
GitHub: https://github.com/water-rs/waterui
Tutorial book: https://water-rs.github.io/waterui/
API Reference: https://docs.rs/waterui/
I'd love to hear your thoughts! Especially interested in:
This is my first major open source project in Rust, so any feedback on the code structure would also be appreciated!
5 posts - 2 participants
🏷️ Rust_feed