Freya is native GUI library for Rust powered by 🧬 Dioxus and 🎨 Skia.
fn app(cx: Scope) -> Element {
let mut count = use_state(cx, || 0);
render!(
container {
height: "20%",
width: "100%",
background: "rgb(233, 196, 106)",
padding: "12",
color: "rgb(20, 33, 61)",
label {
font_size: "20",
"Number is: {count}"
}
}
container {
height: "80%",
width: "100%",
background: "rgb(168, 218, 220)",
color: "black",
padding: "12",
onclick: move |_| count += 1,
label { "Click to increase!" }
}
)
} |
Run:
cargo run --example counter
Add Freya as a dependency via git (it's not published on crates.io yet) in your Cargo.toml
:
freya = { git = "https://github.com/marc2332/freya" }
dioxus = { git = "https://github.com/DioxusLabs/dioxus", rev="49c5a5043a16fc82210af146c345793dd448e519", features = ["macro", "hooks"]}
- Support for Windows, Linux and MacOS
- Text, containers, etc elements
- Headless testing of components
- Components crate (with theming support)
- Scroll views
- Virtualized scroll views
- Button
- Slider
- Switch
- Dropdown
- and a few more
- Keyboard and Mouse events
- Hooks crate for text editing, animations, webcam, theming..
- SVG and Images
- DevTools panel (enabled via a feature)
- Hot reload
- Performant
- Low memory usage
- Lightweight
- Good developer experience
- Cross platform
You can see the tracking issues labeled with the tracking
label to know what features are implemented and which ones are not, yet.