Skip to content

zion-sati/fui-rs

Repository files navigation

FUI-RS — retained Rust UI for native desktop and WebAssembly

FUI-RS CI crates.io docs.rs npm License: AGPL-3.0 or commercial

FUI-RS is a retained-mode Rust UI SDK that runs the same application UI as a real native macOS, Windows, or Linux desktop application and in the browser through WebAssembly. Native applications do not use Electron or a WebView.

The SDK includes retained nodes, controls, layout, themes, events, popups, dialogs, editable text, selection, custom drawing, workers, host services, accessibility semantics, and Rust-specific authoring macros.

fui-rs-home.mp4
More demo videos (inc. Galaga space shooter game)...
fui-rs-text-n-fonts.mp4
fui-rs-advanced.mp4
fui-rs-immediate-drawing.mp4
fui-rs-galaga.mp4

Start a project

For a new native, web, or universal application, use cargo-fui:

Install stable Rust and Cargo through rustup, then:

rustc --version
cargo --version
cargo install --locked cargo-fui
cargo fui new my-app --target universal
cd my-app
cargo fui dev

Choose native for desktop only, web for browser only, or universal for a shared retained UI with explicit native and web adapters.

For a browser-only application that needs the npm-oriented simple or routed/MVC scaffolds, use create-fui-rs-app:

npx @effindomv2/create-fui-rs-app my-app
cd my-app
npm install
npm run dev

See the FUI-RS quickstart for prerequisites and the exact differences between these entry points.

How the stack fits together

Your retained Rust UI
        │
        ▼
      FUI-RS          controls, themes, events, application APIs
        │
        ▼
     EffinDOM         layout, text, rendering, input, semantics
       ╱   ╲
      ▼     ▼
 native     browser/WebAssembly
  host

cargo-fui sits around this stack as project/build/package tooling. FUI-RS package metadata identifies the compatible EffinDOM runtime, so application developers do not manually synchronize runtime versions.

Minimal retained UI

use fui::prelude::*;

fn build_page() -> FlexBox {
    ui! {
        column().fill_size().padding(24.0, 24.0, 24.0, 24.0) {
            text("Hello from FUI-RS").font_size(28.0),
            button("Click me").on_click(|_| {
                logger::info("App", "Button clicked");
            }),
        }
    }
}

fui_app!(FlexBox, build_page);

FUI-RS is retained mode:

  • Construct controls once.
  • Keep stateful controls when callbacks need to mutate them.
  • Mutate retained objects from events, timers, host callbacks, or signals.
  • Use ui! as construction syntax, not as a recurring render function.

FUI-RS maps retained inheritance to capability traits. Node supplies common retained state and raw events, while visual controls expose layout, style, flex-layout, child-container, text, focus, and interaction capabilities as appropriate.

Current status

FUI-RS is feature-rich early access. It already supports substantial retained UI and native packaging, but breaking API and generated-project changes remain possible before 1.0 when correctness or Rust ergonomics require them.

Current boundaries:

  • Native support is desktop macOS, Windows, and Linux. iOS and Android are not currently supported.
  • Linux AT-SPI support is implemented; validation across the wider desktop and screen-reader ecosystem remains early.
  • Browser-native find-on-page cannot be reproduced perfectly for all mirrored, hidden, and virtualised content.
  • Native and web targets intentionally expose different platform-service adapters where the underlying capability differs.
  • Browser-only routed applications use separate WASM modules and a shared browser shell; native applications do not use that routing model.
  • Native packaging does not supply an application's production signing identity, store account, notarization credentials, or distribution policy.
  • The supported CI matrix cannot represent every Linux desktop environment, browser, GPU, or driver.
  • The third-party control and integration ecosystem is new.

Open a discussion when evaluating FUI-RS for an application whose requirements touch one of these boundaries.

Community projects

Documentation

Contributing

Application developers should begin with the quickstart. Contributors working on the SDK should follow the FUI-RS contributor quickstart.

License

FUI-RS is AGPL-3.0-only or commercially licensed. See the commercial licensing terms. EffinDOM runtime components are distributed under their own terms; FUI-RS's AGPL licence should not be inferred to apply to the runtime itself.

About

Build WPF/SwiftUI-grade web apps in Rust running on the browser. No DOM. No CSS. No virtual DOM diffing.

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

Sponsor this project

Contributors

Languages