linebender /xilem

An experimental Rust native UI framework

★ 5,611⑂ 250👁 65⑃ 1,540● 325▤ 5
RustApache-2.0Created 2022-11-16
TA的项目
下载:v0.4.0v0.4.0 ↓0.4.02025-10-29
+3
日增长
5,611
stars
250
forks
65
watchers
1,540
prs
325
issues
5
releases

README

Xilem

An experimental Rust architecture for reactive UI









Xilem and Masonry provide an experimental high-level architecture for writing GUI apps in Rust.

Masonry is a foundational crate for building natively compiled GUIs in Rust.
It provides a retained widget tree and runs event handling and update passes on it.

Xilem is a high-level reactive framework inspired by React, SwiftUI and Elm.
It lets users create a lightweight view tree, and changes the rendered app based on changes to the tree.
It has a web backend and a Masonry backend.

masonry/ and xilem/ are the respective entry points of these projects for new users. 
See ARCHITECTURE.md for details about the repository structure.

Xilem and Masonry are built on top of:

- winit for window creation.
- Vello and wgpu for 2D graphics.
- Parley and Fontique for the text stack.
- AccessKit for plugging into accessibility APIs.

Note for new users: If you're not sure what to use between Xilem and Masonry, you probably want Xilem. In general, if you're trying to make an app with minimum hassle, you probably want Xilem. Xilem is a UI framework, whereas Masonry is a toolkit for building UI frameworks (including Xilem).


 Screenshots







From https://github.com/StefanSalewski/xilem-chess/










The calc_masonry example.










The to_do_mvc example.





 Getting started

After cloning this repository, you can try running the examples, such as the to_do_mvc example shown above:

sh
cargo run --example to_do_mvc


To add Xilem as a dependency to your project, run

sh
cargo add xilem



 Prerequisites

 Linux and BSD

You need to have installed pkg-config, clang, and the development packages of wayland, libxkbcommon, libxcb, and vulkan-loader.
Most distributions have pkg-config installed by default.

To install the remaining packages on Fedora, run:

sh
sudo dnf install clang wayland-devel libxkbcommon-x11-devel libxcb-devel vulkan-loader-devel


To install the remaining packages on Debian or Ubuntu, run:

sh
sudo apt-get install clang libwayland-dev libxkbcommon-x11-dev libvulkan-dev


There's a Nix flake in docs/ which may be used for developing on NixOS:

 [!NOTE]
 
 This flake is provided as a starting point, and we do not routinely validate its correctness.
 We do not require contributors to ensure that this accurately reflects the build requirements, as we expect most contributors (and indeed many maintainers) will not be using NixOS.
 If it is out of date, please let us know by opening an issue or PR.

sh
 For all crates within this repo
nix develop ./docs
 For a specific crate
nix develop ./docsxilem
nix develop ./docsmasonry
nix develop ./docsxilem_web


 Recommended Cargo Config

The Xilem repository includes a lot of projects and examples, most of them pulling a lot of dependencies.

If you contribute to Xilem on Linux or macOS, we recommend using split-debuginfo in your .cargo/config.toml file to reduce the size of the target/ folder:

toml
[profile.dev]
 One debuginfo fil

Top issues

Latest release

v0.4.0 v0.4.0 2025-10-29
| Name | Crates.io | Docs |
| :--- | :--- | :--- |
| xilem | Crates.io | Docs |
| xilem_web | Crates.io | Docs |
| xilem_core | Crates.io | Docs |
| masonry | Crates.io | Docs |
| masonry_winit | Crates.io | Docs |
| masonry_testing | Crates.io | Docs |
| masonry_core | Crates.io | Docs |

This release has an [MSRV] of 1.88.

In the nearly six months since the last release, we have put a lot of focus into making Xilem and Masonry more suitable for general use. In addition, we have gained several important features, including initial support for using Masonry with multiple windows.

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON