# Mirui (development, crate 0.57.0) > Possibly the most elegant declarative embedded graphics library in Rust. > `no_std` + `alloc`, ECS-driven scene graph, reactive `#[model]` bindings, spring/tween motion, shaped bidirectional & path typography, and pluggable backends (software framebuffer, SDL2 CPU/GPU, WGPU, Web Canvas, Linux DRM/fbdev, NuttX). - Repository: https://github.com/W-Mai/mirui (commit `d624dda55a1f97a3652a09dc7005c668e5e37549`) - Live Gallery: https://mirui.rs/ - API Reference: https://docs.rs/mirui ## Authoring Cheat Sheet (Macros & Contracts) - **`#[model]` / `#[observe]` / `#[persist]`**: Declare reactive application state on structs and `impl` blocks. Observed fields generate getter methods (`task.done()`). Always call the getter inside `${...}` so the reactive scope records the dependency. Model methods return owned values. - **`#[compose]` & `ui! { ... }`**: Prepare stack-held UI compositions. Pass reactive inputs with `prop!(T)` and models with `model!(T)`. Key dynamic lists with `walk ${ list.entries() } with row by row.0 { ... }`. - **`#[event]`**: Define typed event callbacks (`on Tap(my_event::callback(arg, model))`). Parameters can request `event!(Tap)`, `entity!()`, `model!(T)`, `res!(T)`, `query!(...)`, and `commands!()`. - **`#[animate(component = ...)]` & `FollowBounds`**: Drive smooth transitions from ECS systems or attach `FollowBounds::new(id("target")).with_transition(INTERACTIVE.into())` to let a view chase another widget's layout bounds. - **`#[component]` & `#[view(component = ...)]`**: Extend `ui!` with custom widgets that emit `DrawCommand::Fill`, `DrawCommand::FillPath`, or `DrawCommand::StrokePath` against `paint.rect()`. ## Tutorial (7 Runnable Checkpoints) - [Overview (EN)](https://mirui.rs/docs/dev/learn/): Build a complete task list from a bare window to WebAssembly. - [亲手写一个任务清单 (ZH)](https://mirui.rs/docs/dev/zh/learn/): 七章互动课程。 - [01 · Open a window](https://mirui.rs/docs/dev/learn/window.html) / [打开窗口](https://mirui.rs/docs/dev/zh/learn/window.html) - [02 · Complete a task](https://mirui.rs/docs/dev/learn/state.html) / [点亮第一枚勾选框](https://mirui.rs/docs/dev/zh/learn/state.html) - [03 · Add, remove, and filter](https://mirui.rs/docs/dev/learn/collections.html) / [增删与筛选列表](https://mirui.rs/docs/dev/zh/learn/collections.html) - [04 · Reuse components and styles](https://mirui.rs/docs/dev/learn/components.html) / [提炼组件与样式表](https://mirui.rs/docs/dev/zh/learn/components.html) - [05 · Give the interface motion](https://mirui.rs/docs/dev/learn/motion.html) / [注入物理动效](https://mirui.rs/docs/dev/zh/learn/motion.html) - [06 · Save and restore the list](https://mirui.rs/docs/dev/learn/storage.html) / [断电与重开之后](https://mirui.rs/docs/dev/zh/learn/storage.html) - [07 · Run it in the browser](https://mirui.rs/docs/dev/learn/web.html) / [编译进浏览器画布](https://mirui.rs/docs/dev/zh/learn/web.html) ## Common Patterns & Interface Guides - [Common Patterns (EN)](https://mirui.rs/docs/dev/learn/recipes.html) / [常用界面写法 (ZH)](https://mirui.rs/docs/dev/zh/learn/recipes.html): Live examples for reactive thresholds, flex sizing, spring FollowBounds, custom vector views, curve text, and scrolling. - [Quickstart & Targets](https://mirui.rs/docs/dev/quickstart.html) / [环境搭建与多端工程](https://mirui.rs/docs/dev/zh/quickstart.html): Toolchain setup for desktop SDL, ESP32-C3, Android, iOS, and multi-target workspaces. - [Reactive State & Styles](https://mirui.rs/docs/dev/state-management.html) / [响应式状态与样式](https://mirui.rs/docs/dev/zh/state-management.html): Models, `Signal`, `Computed`, `StyleSheetPlugin`, and flush boundaries. - [Composition, Roles & Views](https://mirui.rs/docs/dev/composition.html) / [组合、角色与自定义视图](https://mirui.rs/docs/dev/zh/composition.html): `#[compose]`, `prop!(T)`, `res!(T)`, `#[system]`, `#[view]`, and `ui!(compose Name)` niches. - [Model Collections](https://mirui.rs/docs/dev/model-collections.html) / [有界列表与键值复用](https://mirui.rs/docs/dev/zh/model-collections.html): Bounded `ModelList`, `ModelMap`, `ModelSet`, and stable `ModelItemId` keys. - [Events & Callbacks](https://mirui.rs/docs/dev/events.html) / [手势识别与事件回调](https://mirui.rs/docs/dev/zh/events.html): Gesture recognition, bubbling, and `#[event]` handlers. - [Navigation & Motion](https://mirui.rs/docs/dev/navigation.html) / [页面导航与物理动效](https://mirui.rs/docs/dev/zh/navigation.html): `FollowBounds`, `NavigationStack`, `PageView`, springs, and tweens. - [Scrolling](https://mirui.rs/docs/dev/scrolling.html) / [滚动容器与惯性控制](https://mirui.rs/docs/dev/zh/scrolling.html): `ScrollOffset`, `ScrollConfig`, momentum, and nested scrollers. ## Views, Typography, Assets & Backends - [Building Custom Widgets](https://mirui.rs/docs/dev/widget-events.html) / [自定义控件与绘制](https://mirui.rs/docs/dev/zh/widget-events.html): Custom `#[view]` descriptors, input delivery, and `TextDocument` / `TextEditing` internals. - [Typography](https://mirui.rs/docs/dev/typography.html) / [字体栈与曲线排字](https://mirui.rs/docs/dev/zh/typography.html): Shaped text, `FontToken::FALLBACK`, bidirectional scripts, and text along Bézier paths (`TextPath`). - [Text Editing](https://mirui.rs/docs/dev/text-editing.html) / [文本编辑与输入法](https://mirui.rs/docs/dev/zh/text-editing.html): Custom text editors, selection geometry, and IME commit handling. - [Clipboard](https://mirui.rs/docs/dev/clipboard.html) / [跨平台剪贴板](https://mirui.rs/docs/dev/zh/clipboard.html): Cross-platform clipboard integration. - [Resources](https://mirui.rs/docs/dev/resources.html) / [静态与托管资源池](https://mirui.rs/docs/dev/zh/resources.html): `ResourceManager`, static/factory entries, and bounded caches. - [Shared Textures](https://mirui.rs/docs/dev/shared-textures.html) / [跨线程纹理移交](https://mirui.rs/docs/dev/zh/shared-textures.html): Cross-thread `sync` textures and device upload lifetimes. - [Persistence](https://mirui.rs/docs/dev/persistence.html) / [状态快照与自动落盘](https://mirui.rs/docs/dev/zh/persistence.html): `PersistencePlugin`, `#[persist]`, and storage backends. - [Porting Display & Input](https://mirui.rs/docs/dev/porting.html) / [屏幕、输入与硬件加速移植](https://mirui.rs/docs/dev/zh/porting.html): `FramebufSurface`, custom `Surface` + `FramebufferAccess`, double-buffered mirroring, touch/rotary/key input, `compose_backend!` 2D DMA engines, and `no_std` clocks/storage/audio. - [Surface Sizing](https://mirui.rs/docs/dev/surface-sizing.html) / [逻辑视口与缩放比](https://mirui.rs/docs/dev/zh/surface-sizing.html): Logical viewports, HiDPI scale factors, and dynamic resizing. - [Backend Targets](https://mirui.rs/docs/dev/backend-targets.html) / [各平台后端实现](https://mirui.rs/docs/dev/zh/backend-targets.html): Software rasterizer, SDL2, SDL-GPU, WGPU, Web Canvas, Linux DRM/fbdev, and NuttX. - [Backend Fallback](https://mirui.rs/docs/dev/backend-fallback.html) / [混合后端与软件回退](https://mirui.rs/docs/dev/zh/backend-fallback.html): `compose_backend!`, partial damage redraws, and offscreen composition. - [Timing Diagnostics](https://mirui.rs/docs/dev/timing-diagnostics.html) / [帧耗时剖析与追踪](https://mirui.rs/docs/dev/zh/timing-diagnostics.html): Frame-phase profiling with the `perf` feature. - [CI Checks](https://mirui.rs/docs/dev/ci.html) / [编译期契约与门禁](https://mirui.rs/docs/dev/zh/ci.html): Compile-fail and architectural contract tests.