xengui
The core, retained-mode GUI library at the heart of the XenGui ecosystem.
xengui provides the widget tree, hooks-based state model, Flexbox/Grid layout engine (via taffy), style system, text handling, and interruptible reconciler. It has no GPU or windowing dependencies of its own - rendering is delegated to a [RenderBackend] implementation (such as xengui-wgpu), and window/event integration is handled by a platform crate (such as xenframe), so xengui stays fully portable across native and WebAssembly targets.
Features
- Retained-mode state - React-style hooks (
use_state,component) drive re-renders without a virtual-DOM diffing framework bolted on top. - Interruptible reconciler - tree diffing runs as explicit, resumable work units instead of a single blocking pass.
- Flexbox & Grid layout - layout system via
taffy, including flex direction, wrapping, alignment, gaps, and grid tracks. - Declarative styling -
Style/StyleBuilderAPI covering colors (including OKLCH), borders, typography, spacing, transitions, and more. - Built-in widgets -
View,Label,Button,Link,TextBox,Image,Svg, andContextMenu, each with hover/pressed/focus/disabled style variants. - Interaction system - unified handling of hover, click, focus, and keyboard events across widgets.
- Backend-agnostic rendering - implement [
RenderBackend] to target any graphics API. - Cross-platform - native targets (Windows, macOS, Linux) and WebAssembly from a single codebase.
For a full application quick start (rendering, event loop, and GPU backend together), see the workspace README.
Example
new
.display
.flex_direction
.align_items
.justify_content
.width
.height
.background
.child
.child;
Installation
Cargo.toml
[]
= "0.2.6"
Most applications should also pull in a platform runtime crate (e.g. xenframe) and a render backend (e.g. xengui-wgpu) - see the workspace README for a full quick-start example.
Documentation
Docs are available at: https://xengui.vercel.app/docs/xengui
License
Apache License 2.0 © 2026 randseas. See LICENSE for details.