Development
Tutorial · Rust + WebAssembly
Build a task list
Start with a bare window and add state bindings, list editing, stylesheets, spring transitions, and local storage, then compile the same crate to the browser.
Chapters
- Open a window
Mount a heading and two static rows inside a desktop window. - Complete a task
Tap a row so its checkmark and the header tally flip on the same frame. - Add, remove, and filter
Key rows byModelItemIdso filtering and deletion never scramble state. - Reuse components and styles
Extract a#[compose]filter button and dim completed rows viaStyleSheetPlugin. - Give the interface motion
Tween the progress bar and let a spring-driven outline chase the active filter. - Save and restore the list
AttachPersistencePluginso tasks survive across restarts. - Run it in the browser
Hand the exact sameinstallfunction toWebCanvasSurfaceand test it at phone width.
Run on your machine
Install Rust and SDL2, check out the commit matching this manual, and launch chapter 7 natively:
sh
git clone https://github.com/W-Mai/mirui.git
cd mirui
git checkout 'd624dda55a1f97a3652a09dc7005c668e5e37549'
cargo run -p mirui-first-app --features desktop --example desktop -- 7