A flexible UI toolkit for Rust, powered by wgpu.
SUI takes its name from 水 (sui, water): the toolkit should take the shape of the application, not the other way around. Its retained widget tree and reactive state are tools, not rules. An application can use the complete stack, replace parts of it, or embed only the runtime. Custom code joins through a small widget contract, so SUI remains useful without owning the application's architecture.
SUI also handles several hard edges of modern application UI. Virtual collections keep identity and scroll position stable while data changes. The document model consumes streaming Markdown without throwing away finished layout. Typed application messages are routed independently of the paint tree, and managed overlays and responsive panes preserve focus as structure changes. The same semantics power accessibility, UI testing, and inspection.
Rendering follows the same idea: widgets emit renderer-neutral scenes, while
a retained wgpu compositor handles the normal GPU path. SUI is aimed at
technical and creative software where ordinary controls need to work naturally
beside custom graphics.
Explore the live SUI widget book →
SUI requires Rust 1.90 or newer and the system libraries normally required by
winit and wgpu on the target platform.
[dependencies]
sui = { package = "sinomo-ui", version = "0.2" }The package is named sinomo-ui because the sui registry namespace is
occupied. The dependency alias keeps application imports concise.
use sui::prelude::*;
fn main() -> Result<()> {
let content = Stack::vertical()
.spacing(12.0)
.alignment(Alignment::Start)
.with_child(Label::new("Your first SUI window").font_size(24.0))
.with_child(
Button::primary("Continue")
.on_press(|| println!("Hello from SUI!")),
);
App::new()
.main_window("Hello SUI", Padding::all(24.0, content))
.run()
}Run the checked quickstart or open the complete widget book:
cargo run -p sinomo-ui --example quickstart
cargo run -p sinomo-ui-demoThe quickstart tutorial continues from this example.
SUI is pre-1.0 software. The Rust API may continue to evolve during the 0.x
series.
| Surface | Status | Notes |
|---|---|---|
| Rust desktop | Available | Linux, macOS, and Windows through winit and wgpu |
| Headless/testing | Available | Deterministic runtime, semantic interaction, rendering, and screenshots |
| Web | Alpha | Rust/Wasm and WebGPU; used by the live widget book |
| Android | Experimental | Native-activity host with lifecycle-aware surface management |
| Python | Alpha | Working native binding, currently built from source |
| JavaScript | Alpha | Working but incomplete Node/Electron binding, currently built from source |
The web path runs SUI applications through Rust/Wasm and WebGPU; it is not a DOM framework. Applications authored in JavaScript can use the separate Node/Electron API. See Platforms and Cargo features and the JavaScript binding guide for the current boundaries.
Generate API documentation for the checked-out revision with:
cargo doc -p sinomo-ui --no-deps --openThe sinomo-ui facade enables desktop and wgpu by default. Disable default
features when embedding the renderer-neutral runtime or selecting another
platform host.
| Feature | Purpose |
|---|---|
desktop |
Desktop event loop and window integration; also enables wgpu |
web |
Browser/WebAssembly integration; also enables wgpu |
mobile |
Mobile integration, currently Android; also enables wgpu |
wgpu |
Renderer facade and external texture integration |
testing |
Compatibility flag; high-level test APIs live in sinomo-ui-testing |
cargo fmt --all -- --check
cargo test --workspace
cargo clippy --workspace --all-targets --all-features -- -D warningsThe widget book also serves as SUI's integration and visual-validation host. Generate its artifact bundle with:
cargo run -p sinomo-ui-demo --bin sui-demo-artifactsArtifacts are written under target/ui-artifacts/sui-demo/widget-book.
Contributors should read CONTRIBUTING.md;
security issues should follow the security policy.
SUI is licensed under the MIT License.
The bundled sinomo-ui-lucide crate retains its upstream ISC license.