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

  • all: Enables all the features listed below
  • router: Reexport [freya_router] under router
  • i18n: Reexport [freya_i18n] under i18n
  • remote-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.

Modules§

_docs
animation
clipboard
components
elements
engineengine
helpers
i18ni18n
iconsicons
material_designmaterial-design
prelude
radioradio
Reexport freya-radio when the radio feature is enabled.
routerrouter
sdksdk
text_edit
traytray
winit