Crate freya

Crate freya 

Source
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

§Features flags

§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.

Modules§

_docs
animation
clipboard
code_editorcode-editor
Reexport freya-code-editor when the code-editor feature is enabled.
components
elements
engineengine
helpers
i18ni18n
iconsicons
material_designmaterial-design
plotplot
prelude
queryquery
Reexport freya-query when the query feature is enabled.
radioradio
Reexport freya-radio when the radio feature is enabled.
routerrouter
sdksdk
terminalterminal
Reexport freya-terminal when the terminal feature is enabled.
text_edit
traytray
webviewwebview
Reexport freya-webview when the webview feature is enabled.
winit