linebender/xilem: An experimental Rust native UI framework · GitHub

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

masonry Rust has a basic framework for building natively compiled GUIs. It provides a maintained widget tree and runs event handling and update passes on it.

xylem A high-level reactive framework inspired by React, SwiftUI, and Elm. It lets users create a lightweight view tree, and change the rendered app based on changes in the tree. It has a web backend and masonry backend.

masonry/ And xilem/ These projects have respective entry points for new users. Look ARCHITECTURE.md For details about repository structure.

Xylem and masonry are constructed on top of:

  • win it For window manufacturing.
  • Velo and WGPU For 2D graphics.
  • parle and phontik For text stack.
  • accesskit To plug into the Accessibility API.

Note for new users: If you’re not sure what to use between Xylem and Masonry, you probably want Xylem. In general, if you’re trying to build an app with minimal fuss, you probably want Xilem. Xilem is a UI framework, while Masonry is a toolkit for building UI frameworks (including Xilem).

screenshot chess app

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

screenshot calc masonry

calc_masonry Example.

screenshot to do mvc

to_do_mvc Example.

After cloning this repository, you can try to run the example, such as to_do_mvc Example shown above:

cargo run --example to_do_mvc

To add Xilem as a dependency to your project, run

you have to install pkg-config, clangand development package of wayland, libxkbcommon, libxcbAnd vulkan-loader. Most distributions are pkg-config Installed by default.

To install the remaining packages on Fedora, run:

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

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

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

There’s a nix flake in it docs/ Which can be used for development on NixOS:

[!INFO]

This flake is provided as a starting point, and we do not routinely verify its accuracy. We do not require contributors to ensure that this build accurately reflects requirements, as we expect that most contributors (and indeed many maintainers) will not use NixOS. If it’s out of date, please let us know by opening an issue or PR.

# For all crates within this repo
nix develop ./docs
# For a specific crate
nix develop ./docs#xilem
nix develop ./docs#masonry
nix develop ./docs#xilem_web

The Xilem repository contains 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 to reduce file size target/ folder:

[profile.dev]
# One debuginfo file per dependency, to reduce file size of tests/examples.
# Note that this value is not supported on Windows.
# See https://doc.rust-lang.org/cargo/reference/profiles.html#split-debuginfo
split-debuginfo="unpacked"

Minimum Supported Rust Version (MSRV)

This version of Xilem has been verified to compile Rust 1.92 And later.

The requirement for Rust versions may increase in future versions of Xilem. This will not be considered a breaking change and can happen even with minor patch releases.

Xilem development is discussed by linebender Zulip, specifically in the #xilem channel. All public content can be read without logging in.

Contributions via pull requests are welcome. The Rust Code of Conduct applies.

Unless you explicitly state otherwise, any Contribution you intentionally submit for inclusion in the Work will be licensed as set forth in the License section, without any additional terms or conditions, as defined in the Apache 2.0 License.

Licensed under the Apache License, Version 2.0 (License or http://www.apache.org/ licenses/LICENSE-2.0)

Some of the files used are under different licenses, for example:

  • font file (RobotoFlex-Subset.ttf) In xilem/resources/fonts/roboto_flex/ Licensed only as documentation in that folder (and not licensed under the Apache License, version 2.0).
  • data file (status.csv) In xilem/resources/data/http_cats_status/ Licensed only as documentation in that folder (and not licensed under the Apache License, version 2.0).
  • data file (emoji.csv) In xilem/resources/data/emoji_names/ Licensed only as documentation in that folder (and not licensed under the Apache License, version 2.0).



<a href

Leave a Comment