Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Muse Toolkit
MTK is a declarative, retained-mode GUI toolkit for Rust. It pairs an Elm-inspired functional interface with a custom Flexbox layout engine, native WGPU hardware rendering, and Parley typography.
[!WARNING] Still experimental and under active development. Not recommended for production use.
Philosophy
- Declarative Views, Retained Elements: Write functional, declarative views (
view(&state) -> impl View<State>). MTK retains layout nodes and updates only changed properties viarebuild(). - Primitives Over Monoliths: Focus on flexible, unopinionated primitives rather than a rigid widget set, making it easy to build custom workstation tools, editors, and domain components.
- Accessible Core: The coordinator (
Context), layout engine (muse.h), typography metrics, and GPU canvas passes are public so developers can build on top of MTK without fighting the framework. - Source Introspection: Every widget tracks its call site with
#[track_caller]for live in-tree debugging and inspection.
Use the master branch
# Cargo.toml
= { = "https://github.com/luxluth/mtk.git", = "master" }
Core Technologies
MTK brings together proven technologies from across the systems and graphics ecosystem:
- Layout: Rust Flexbox engine
- Graphics: WGPU — Cross-platform GPU rendering targeting Vulkan, Metal, and DirectX 12.
- Typography: Parley, Swash — Multi-font styling, dynamic font fallback, OpenType ligatures, and inline span geometry.
- Windowing: winit — Native window creation, DPI scaling, and event handling.
- Images: zune-image, resvg — Asynchronous streaming loader (
mtk-image-loader) with byte-bounded LRU caching. - Inspector: Ratatui — Built-in terminal UI layout inspector.
- Clipboard: arboard — Cross-platform clipboard read and write support.
Quick Start Example
Below is a complete, minimal example that creates a window displaying text:
use clr;
use ;
use ViewStyleExt;
use text;
use ;
State Management and Lenses
MTK uses unidirectional data flow with typed messages. To decompose large application states into reusable sub-views without cloning, MTK provides Lenses and the Adapter Pattern:
use Lens;
use *;
use ;
Examples
To run the included widget gallery:
Acknowledgments
MTK is inspired by Xilem and borrows architectural concepts for reactive, declarative GUI representation and state adaptation in Rust.