| Crates.io | waterui-layout |
| lib.rs | waterui-layout |
| version | 0.1.0 |
| created_at | 2025-09-07 14:23:12.285172+00 |
| updated_at | 2025-09-07 14:23:12.285172+00 |
| description | Layout components for WaterUI |
| homepage | |
| repository | https://github.com/water-rs/waterui |
| max_upload_size | |
| id | 1828174 |
| size | 21,321 |
A cross-platform UI framework for Rust with cross-platform native rendering
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(move || count.increment(1)),
button("Reset")
.action(move || count.set(0))
.foreground_color(Color::red()),
))
.spacing(10),
))
.padding(20)
.spacing(15)
}
Check it here.