Try code in the browser
Open the playground, replace Notifications in the switch example with your own title, and select Run. Toggle the switch on the right: the status text and count update with it. You do not need to install Rust or start a compilation service.
A prebuilt WebAssembly engine parses and interprets Rust UI code, then calls rs_lvgl_ui and LVGL to create and draw the widgets. Layout, input and messages run in a browser Worker. Edited source stays in your browser.
What you can change
All seven documentation examples are editable. Start with text, spacing and dimensions, then change the state in App and the message handling in update.
Import use rs_lvgl_ui::prelude::*; and follow the function syntax in the examples. Use Color::rgb(240, 120, 60) for colors. Integers support i8 through i64 and u8 through u64; isize and usize use 32 bits. A value outside its declared field type or UI parameter range reports an error instead of being truncated.
type Action = BrightnessAction selects this component's action type. The left-hand Action belongs to the App interface; the component chooses the type on the right. Use .width(px(240)) for dimensions and read fonts and colors directly from theme.title_font and theme.text.
For example, keep a slider value in state and write it back when a message arrives:
Copy the complete example into the playground and drag the slider. The number changes with it. view describes the current screen and update changes state, following the same structure as a device application.
When code fails
Diagnostics include a source line you can select to return to the editor. Syntax errors, unsupported calls, out-of-range values and execution limits have separate messages. Native LVGL view-validation errors point to view; the message describes the invalid tree.
If an edit fails, the last successful image stays visible. Fix the code and run it again. Reset restores the example source; Restart preview starts the currently previewed code from its initial state. Every successful run creates a new application, so earlier clicks do not carry over.
The browser engine does not execute rustc or perform full type inference, ownership or borrow checking. It checks supported values and UI parameters at runtime. Code that runs here still needs to compile with Cargo in your application. Unsupported syntax is rejected even in branches that do not execute.
Execution is bounded to keep the page responsive: 32 KiB of source, 64 levels of source nesting, 32 function calls deep, 96 evaluation levels, and 20,000 evaluation steps per view or message update. A collection can contain 512 items, a view 512 nodes, a value 4096 entries, text 16 KiB, and a run 4096 distinct keys. Exceeding a limit reports an error. An unresponsive Worker is terminated after 5 seconds.
When you need full Rust
External crates, other trait implementations, loops, asynchronous code, pointers and unsafe, custom macros, and component features outside the table require the local compiler. Browser mode never switches to it automatically.
Install Rust, a C compiler and libclang as described in Getting started, then clone rs_lvgl_website with --recurse-submodules. The website README lists the dependency preparation commands. The local playground also needs Node.js and npm (verified with Node.js 24), and Emscripten (verified with 6.0.13). On macOS, run brew install emscripten; on Linux, use the official emsdk. Make sure emcc, em++, embuilder and em-config are on PATH, then run these commands from the website root:
Open the URL printed in the terminal, normally http://127.0.0.1:4173/rs_lvgl_website/. In the playground, open Run settings at the top right and select Local Rust compiler under Run mode. Edit the code and select Run to see the rebuilt application and interact with it. You can also change display size and theme, or enable automatic runs.
Each successful run starts with fresh application state. A failed compilation shows source locations and retains the last working preview. The service listens on loopback, does not upload source, and compiles and runs code with your account's permissions. Run only trusted code. Edits supported by Browser mode do not require this toolchain.