freya

Native GUI library for đŸĻ€ Rust powered by đŸ§Ŧ Dioxus and 🎨 Skia.

MIT License

Downloads
88.4K
Stars
1.1K
Committers
5

Freya đŸĻ€

Website | Nightly Docs | Stable Docs | Book | Discord

Freya is a cross-platform GUI library for Rust powered by đŸ§Ŧ Dioxus and 🎨 Skia.

It does not use any web tech, check the Differences with Dioxus.

⚠ī¸ It's currently work in progress, but you can already play with it! You can join the Discord server if you have any question or issue.

fn app() -> Element {
    let mut count = use_signal(|| 0);

    rsx!(
        rect {
            height: "50%",
            width: "100%",
            main_align: "center",
            cross_align: "center",
            background: "rgb(0, 119, 182)",
            color: "white",
            shadow: "0 4 20 5 rgb(0, 0, 0, 80)",
            label {
                font_size: "75",
                font_weight: "bold",
                "{count}"
            }
        }
        rect {
            height: "50%",
            width: "100%",
            main_align: "center",
            cross_align: "center",
            direction: "horizontal",
            Button {
                onclick: move |_| count += 1,
                label { "Increase" }
            }
            Button {
                onclick: move |_| count -= 1,
                label { "Decrease" }
            }
        }
    )
}

Want to try it? 🤔

👋 Make sure to check the Setup guide first.

⚠ī¸ If you happen to be on Windows using windows-gnu and get compile errors, maybe go check this issue.

Clone this repo and run:

cargo run --example counter

You can also try freya-template

Usage 📜

Add Freya and Dioxus as dependencies:

freya = "0.2"
dioxus = { version = "0.5", features = ["macro", "hooks"], default-features = false }

Contributing 🧙‍♂ī¸

If you are interested in contributing please make sure to have read the Contributing guide first!

Features ✨

  • ⛏ī¸ Built-in components (button, scroll views, switch and more)
  • 🚇 Built-in hooks (animations, text editing and more)
  • 🔍 Built-in developer tools (tree inspection, fps overlay)
  • 🧰 Built-in headless runner to test UI
  • 🎨 Theming support
  • 🛩ī¸ Cross-platform (Windows, Linux, MacOS)
  • đŸ–ŧī¸ SKSL Shaders support
  • 📒 Multi-line text editing
  • đŸĻž Accessibility support
  • 🧩 Compatible with dioxus-sdk and other Dioxus renderer-agnostic libraries

Goals 😁

  • Performant and low memory usage
  • Good developer experience
  • Cross-platform support
  • Decent Accessibility support
  • Useful testing APIs
  • Useful and extensible built-in components and hooks

Support 🤗

If you are interested in supporting the development of this project feel free to donate to my Github Sponsor page.

Thanks to my sponsors for supporting this project! 😄

Special thanks đŸ’Ē

  • Jonathan Kelley and Evan Almloff for making Dioxus and all their help, specially when I was still creating Freya.
  • Armin for making rust-skia and all his help and making the favor of hosting prebuilt binaries of skia for the combo of features use by Freya.
  • geom3trik for helping me figure out how to add incremental rendering.
  • Tropical for this contributions to improving accessibility and rendering.
  • And to the rest of contributors and anybody who gave me any kind of feedback!

🤠 Projects

Valin ⚒ī¸ is a Work-In-Progress cross-platform code editor, made with Freya đŸĻ€ and Rust, by me.

MIT License