π¦
Freya
Website | Docs | Book | Discord
Freya is a native GUI library for Rust powered by
fn app(cx: Scope) -> Element {
let mut count = use_state(cx, || 0);
render!(
rect {
height: "20%",
width: "100%",
background: "rgb(233, 196, 106)",
padding: "12",
color: "rgb(20, 33, 61)",
label {
font_size: "20",
"Number is: {count}"
}
}
rect {
height: "80%",
width: "100%",
background: "rgb(168, 218, 220)",
color: "black",
padding: "12",
onclick: move |_| count += 1,
label { "Click to increase!" }
}
)
} |
π€
Want to try it? Clone this repo and run:
cargo run --example counter
You can also try freya-template
π
Usage 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="11c9abcf7ce731ccb4a44c52de383c090ab319af", features = ["macro", "hooks"]}
β¨
Features - Support for Windows, Linux and MacOS
- Text, containers, images, svg, etc
- Headless testing
- Hot reload
- Optional DevTools panel
- Easy multiline text editing
- 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, animating, theming..
π
Goals - Performant and low memory usage
- Good developer experience
- Cross-platform
- Provide accessibility APIs
- Provide testing APIs
- Provide useful built-in components and hooks
β
Status You can see the tracking issue to know what features are implemented and which ones are not, yet.