Skip to content
zion-satiPublic

About

Build WPF/SwiftUI-grade web apps in Rust running on the browser, MacOS, Windows and Linux without Electron or WebView. No DOM. No CSS. No virtual DOM diffing.

Topics

Resources

Contributing

Stars

53 stars

Watchers

0 watching

Forks

Repository files navigation

FUI-RS — cross-platform retained Rust UI for web and native desktop

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

FUI-RS is a web-born, cross-platform retained-mode UI framework for Rust. One application model runs in browsers through WebAssembly and as a real native application on macOS, Windows, and Linux, without Electron or a WebView. Android and iOS are not supported yet.

The browser is a primary target, not a compatibility layer. FUI-RS supports the web platform facilities application UI depends on, including accessibility, IME and text editing, password-manager integration, workers, history, files, touch input, and asynchronous assets. Its native hosts reuse that architecture rather than defining a separate framework.

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, including the Galaga-style space shooter
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 the platform compiler and linker first: Xcode Command Line Tools on macOS; Visual Studio 2022 Build Tools with Desktop development with C++ and a Windows SDK on Windows; or a C/C++ toolchain and the required native development libraries on Linux. Windows ARM64 also requires the ARM64 C++ build tools.

Then install stable Rust and Cargo through rustup:

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
                     ╱             ╲
                    ▼               ▼
            Browser host      Native desktop host
            WebAssembly       macOS / Windows / Linux

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.
  • Accessibility projection is implemented through DOM/ARIA on the web, NSAccessibility on macOS, Microsoft UI Automation on Windows, and AT-SPI on Linux. Broad compatibility testing across screen readers, browser combinations, and Linux desktop environments remains early.
  • Find-on-page is implemented through retained find for the normal desktop shortcut and projected semantic text for mobile or explicitly invoked browser-native find. Browser-native highlights can render with a slightly different DOM font from the canvas text.
  • 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 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

The live routed demo demonstrates the browser/npm workflow. Native and packaging claims are validated separately by cargo-fui fixtures and native platform tests.

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, MacOS, Windows and Linux without Electron or WebView. No DOM. No CSS. No virtual DOM diffing.

Topics

Resources

Contributing

Stars

53 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Contributors

Languages