aspnxdd / freya

A GUI library for Rust powered by Skia and Dioxus.

Home Page:https://github.com/marc2332/freya

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Freya πŸ¦€

Discord Server Github Sponsors

A GUI library for Rust powered by Skia and Dioxus.

⚠️ It's currently work in progress and not usable for production, but you can already play with it! You can join the Discord server if you have any question.

fn app(cx: Scope) -> Element {
    let mut count = use_state(&cx, || 0);

    cx.render(rsx!(
        container {
            height: "20%",
            width: "100%",
            background: "rgb(233, 196, 106)",
            padding: "25",
            color: "rgb(20, 33, 61)",
            label { 
                font_size: "20", 
                "Number is: {count}"
            }
        }
        container {
            height: "80%",
            width: "100%",
            background: "rgb(168, 218, 220)",
            color: "black",
            padding: "25",
            onclick: move |_| count += 1,
            label { "Click to increase!" }
        }
    ))

Freya

Want to try it? πŸ€”

Note for Windows: You need Visual Studio 2022.

Windows & MacOS:

cargo run --example counter

Linux:

cargo run --example counter --features x11

Features ✨

  • Label and paragraphs
  • Containers and rectangles
  • Scroll views (nested too)
  • Click, wheel, mouse /down/leave/over events
  • Windows, Linux (needs x11 feature) and MacOS support
  • Components library
  • Animation hook

Goals 😁

  • Fast
  • Low memory usage
  • Lightweight
  • Secure
  • Full cross platform
  • Fluid animations

Ideas πŸ’­

  • Tauri integration
  • Devtools

TO-DO 🚧

Besides all the tracking issues, here are some of the things to do:

  • Support for percentages in padding
  • Add Flex component (using taffy).
  • Documentation
  • Improve Auto calculation for width and height
  • Investigate if image diffing can be speeded up (reference: DioxusLabs/dioxus#543 (comment))
  • Better touchpad support
  • Move layout calculation from the layout engine into the node's state? Not sure.
  • Render shadows one layer below it's element to avoid overlapping with it's siblings

MIT License

About

A GUI library for Rust powered by Skia and Dioxus.

https://github.com/marc2332/freya

License:MIT License


Languages

Language:Rust 99.9%Language:Shell 0.1%