Expand description
§Freya
Freya is a declarative, cross-platform GUI 🦀 Rust library, powered by 🎨 Skia.
§Example
fn main() {
// *Start* your app with a window and its root component
launch(LaunchConfig::new().with_window(WindowConfig::new(app)))
}
fn app() -> impl IntoElement {
// Define a reactive *state*
let mut count = use_state(|| 0);
// Declare the *UI*
rect()
.width(Size::fill())
.height(Size::fill())
.background((35, 35, 35))
.color(Color::WHITE)
.padding(Gaps::new_all(12.))
.on_mouse_up(move |_| *count.write() += 1)
.child(format!("Click to increase -> {}", count.read()))
}§Basics
§Learn
- Built-in Components
- Built-in Components Gallery
- i18n
- Animation
- Routing
- Clipboard
- Icons
- Material Design
- Plotters
- Testing
§Features flags
all: Enables all the features listed belowrouter: Reexport [freya_router] under routeri18n: Reexport [freya_i18n] under i18nremote-asset: Enables support for HTTP asset sources for ImageViewer and GifViewer components.tray: Enables tray support using the [tray_icon] crate.sdk: Reexport [freya_sdk] under sdk.gif: Enables the GifViewer component.plot: Enables the plot element.material-design: Reexport [freya_material_design] under material_design.calendar: Enables the Calendar component.icons: Reexport of freya_icons under icons.radio: Reexport [freya_radio] under radio.markdown: Enables the MarkdownViewer component.
§Misc features
devtools: Enables devtools support.performance: Enables the performance overlay plugin.vulkan: Enables Vulkan rendering support.hotpath: Enables Freya’s internal usage of hotpath.