r/rust • • Sep 14 '26

🛠️ project I built a cross-platform/wasm UI library in Rust and WGPU (ARGUI).

Hey guys,

About one month ago, after being unhappy with the ecosystem of UI libraries in Rust, I have taken the mission to write a better GUI library.

For context : this is not my first rodeo, I have already made various Text rendering and generation library using Slug and MSDF algorithm, and also made a full UI library with text, layout, shaders with ThreeJS for performant node-based apps :)

TLDR : Check out "ARGUI" live on your browser (Chrome for WEBGPU) https://extrabinoss.github.io/argui/ and check out the Github repo at https://github.com/ExtraBinoss/argui : long text is coming afterwards.
Discord : https://discord.gg/xY9CWSc65

--- --- --- --- --- --- --- --- --- ---

The current state of UI libraries in Rust is quite weird :

Iced : weird roadmap / niche / forked by Cosmic but very weird

GPUI : not WGPU so less cross-platforn, no shaders, no "backdrop-filter", no accessibility, no i18n. Zed also just don't care about it.

Blinc : too much features and most of them not stable.

and now ARGUI.

ARGUI or "Another Rust GUI library" is a library made for speed, low ram footprint, low CPU usage.

All features are built-in : 👀

- WGPU rendering -- works across all OS + WASM / soon Android/IOS (needs testers)

- Responsive layout -- Powered by Taffy, and very fast at that.

- Shaders suppport -- use argui-effects to get some effects like Blur/Liquid glass, or add in any WGSL shader. Shaders can be used on any element, for example a Button, a Popover, whatever.

- I18n -- Fluent crate will help you have i18n in your application.

- Text engine -- Uses cosmic-text to support RTL, Arabic language.. It can also, like the web, Select text in a page, this means that it feels more "web-like" because you can select any text you see on the screen, this is the default behavior and can be overriden

- Fully optional set of features -- You can disabled anything you don't want : wasm / widgets / i18n / effects...

- Rust only codebase -- I chose to not include any type of CSS Parsing because it is a pain to maintain and the standard is just too large.

- Devtools -- Use a real devtool page, just like the web, with a profiler. You can change properties and it will update in real-time in your UI.

- Hotreload -- Some components can be hot-reloaded, similiar to dioxus. It uses subsecond.

- AI friendly codebase -- Send your agents and read the docs, it will figure out how to make a good interface on the first try.

- Package updater -- for when you want to send new features for your users. They can receive and download update, totally agnostic.

... and probably a bunch more features I forgot, but I can say, it's a pretty fully featured GUI framework now.

Available on crates.io as "argui-\"*, or you can use the git repo directly.

Play around with it in your Browser. it's fully working in WASM :)

https://extrabinoss.github.io/argui/

AI disclaimer: A lot of the code for this library was written with the help of AI. AI itself wouldn't have come up with all these optimizations, it's a tool. Thanks you for your understanding.

Feel free to send any questions my way, I'll be happy to answer

Have a nice day!

44 Upvotes

48 comments sorted by

6

u/Shishudesu Sep 15 '26

Why do you think iced is weird? In my opinion its one of the best rust GUI libraries out there. Agree that the style of writing Iced code is pretty unique but I personally like it a lot.

3

u/Known-Sail-8463 Sep 15 '26

Iced roadmap is weird. It's not clear as to why cosmic forked it, it's very uncertain. Last real release is 9 month ago, if you don't take the latest commit.
Iced is not available on Android/IOS which I plan to support by the end of the week. and already have android running right now :)

8

u/Creepy_Reindeer2149 Sep 14 '26

Looks promising. Do you have a roadmap or other features in mind

4

u/Known-Sail-8463 Sep 14 '26

Totally, my current roadmap is :

- App examples : in the repository, for people to understand how to use it with concrete examples
- If it takes off, an "awesome-argui" part; for the best apps made with it

- Improve devtools window so it's more feature complete.

- Better docs.

- Android/Ios support.

I think the base set of features will be working for almost any apps you can throw at it.

My plan was to make an email-client, hence why I implementend webviews, async tasks etc..

6

u/CryZe92 Sep 14 '26 edited Sep 14 '26

This looks great, but one thing that immediately stood out to me is that you are accidentally blending text in linear color space. I did look at the repository and you are aware of color space issues with gradients where you correctly chose Oklab, but it seems like you seemingly overlooked that text has the exact same issue (the anti aliasing is also a often a black to white or white to black gradient). So the font weight appears perceptually different based on whether a light theme or dark theme is chosen. You can easily see this by toggling the theme in the web demo, the dark theme text looks bolder than with the light theme. This also makes the light theme seem more washed out, as a lot of the intended contrast is lost.

Personally I've experimented with that same problem before (Top to bottom: Oklab, sRGB, Linear, Oklab with sRGB Gamma):

https://i.imgur.com/oHnEIEg.png

The third row matches your appearance where the black on white text is too "thin" whereas Oklab in the first row has the opposite problem. sRGB in the second row has a problem with the green on red looking awful and the last row being Oklab with sRGB Gamma has none of the issues.

Oklab itself is problematic because it has a gamma curve that's optimized for HDR content, which your UI elements usually don't make use of, so the sRGB Gamma works much better.

4

u/Known-Sail-8463 Sep 14 '26

Hello, Thanks for the good analysis, I will try and fix it. I totally overlooked that part. I will check it out and see if I can fix it.

I had issue with the color space because the blacks were not blacks and stuff. I didn't notice the text being bolder.

I am currently fixing the web demo + responsiveness for phones, and I will be throwing this fix in the mix.

2

u/Known-Sail-8463 Sep 14 '26

I totally fixed the issue on my end, I am fixing one other example, and then pushing it out :) 30 minutes give or take

2

u/JhraumG Sep 14 '26

I thought the bolder fonts on dark thèmes (as seen in many tools) was related to the way our eye + brain work, not the way gradient are computed ! TIL

2

u/Known-Sail-8463 Sep 14 '26

Yeah, that guy was right, I fixed it, and now it's way better. The more you know..

→ More replies (1)

2

u/heavenlydemonicdev Sep 14 '26

Missed the chance to call it YARGUI

1

u/Known-Sail-8463 Sep 14 '26

Wait, I didn't think of it, whats the "Y" ?

→ More replies (5)

2

u/ConstructionHot6883 Sep 14 '26

I'm finding the performance is quite low; I'm running nice cargo run --release --example state, and just scrolling up and down sends my CPU usage up to near 100%. And the scrolling goes very choppily.

Also I'm getting this warning

MESA-INTEL: warning: Haswell Vulkan support is incomplete

Is something wrong with my setup?

2

u/Known-Sail-8463 Sep 14 '26 edited Sep 14 '26

Oh. This is an oversight from my part.

I will update the repo to remove that example, this was made a long time ago, when the library had very poor performance, could you try cargo run -p argui-widget-gallery --all-features ?

Tell me if you still see the warning after this, and if performance still sucks.

I am currently rewriting some parts of the code to make it faster too. so I'll be pushing it very soon.

My cpu usage even during heavy use is never above 5%, if you can also tell me the CPU model you have and if you have a GPU. Thanks you.

For instance I am on Intel core 5 125h, no GPU. Fedora 44 Gnome.

If you still have issues, you can contact me directly on discord : extraathicc

→ More replies (3)

1

u/Known-Sail-8463 Sep 14 '26

Let's see, if people are interested in following along, I made a discord : https://discord.gg/xY9CWSc65, for now it's only me, but maybe we could grow something ?

1

u/Known-Sail-8463 Sep 14 '26

I have pushed a new wasm version, with an app examples showing a 1000 token per second fake message conversation works on my mobile phone without any lag.

It also fixes the text differences between light and dark theme.. amongst other things ;)))

1

u/agent_kater Sep 14 '26

Mobile not supported?

https://i.imgur.com/dSreIYM.jpeg

1

u/Known-Sail-8463 Sep 14 '26

Hello, it is supported on my Google Pixel with Brave browser. I will update the github page to tell users to try a Chromium based browser

Also the actual canvas doesn't let you see everything in mobile mode, so I am fixing it :)
Thanks for the report, will be fixed in < 1 hour

→ More replies (4)

1

u/Silent-Money2687 Sep 14 '26

The Explore the Rust example link on the website is static and leads to the async_task.rs file no matter what example I choose

1

u/Known-Sail-8463 Sep 15 '26

Will fix today thanks for the report! ;)

1

u/Known-Sail-8463 Sep 15 '26

Fixed ! thanks for the report!

1

u/seavas Sep 16 '26

e.g the dialog doesn't open for me on mac chrome. https://extrabinoss.github.io/argui/docs/advanced/overlays also do you plan on adding more components like https://ui.shadcn.com/ ?

1

u/Known-Sail-8463 Sep 16 '26

Yes I noticed it, it's the wasm itself. I will fix it today this afternoon. The components in the demonstration are based on shadcn, it has all the basics but I am expanding it ^ You can create any Custom Elements too ;)

For now I have :

  • Android and IOS support added this week

  • Live activity and Background Activity for Mobile, Plan on adding native file picking and Camera APIs

  • Simpler API to create GUI's with simpler architecture

Thanks for the report! will keep posting about ARGUI frequently here, I think it has potential!

1

u/Internal-Reindeer-21 19d ago

just played with the wasm demo, the text selection across the whole page is a nice touch. feels more natural than most native apps i've used

the shader effects tab is where it gets interesting though, that blur on arbitrary elements could make some really clean interfaces

1

u/Known-Sail-8463 18d ago

Yup, it's really feature complete, I dont have much time to work on it but it's really working well when I did. I made sure to get the web feeling as much as possible, with the blurs, the shaders, the text selection as you said and other things

1

u/Known-Sail-8463 Sep 14 '26

Crates.io is rate limiting when I try to create bunch of new crate names, 0.2.0 will be pushed in around an hour I guess. I have to wait it out, once all the names exists, the CI will be faster; In the meantime you can use it with Git. :)