limn documentation
limn is a native UI library for Rust. An application describes its window as a tree of elements; the library lays it out, keeps the state of every control, and produces drawing commands for a backend to paint.
The pages are organized by what you are trying to do.
Learn
Start here if you have never used the library.
| Page | What you get from it |
|---|---|
| Getting started | A window with a working counter, built step by step. |
Understand
Background that explains why the library behaves as it does.
| Page | What it explains |
|---|---|
| Concepts | Elements, the tree, frames, IDs, and who owns state. |
| Animation | What moves, for how long, and how it is switched off. |
Do a specific task
| Page | Task |
|---|---|
| Layout | Arrange, size, center and wrap elements. |
| Theming | Choose colors, corner radii and pace. |
| Guided tours | Point at existing controls and explain them step by step. |
| Testing | Test a component or a screen without a window. |
| Accessibility | What a screen reader is told, and what you have to name. |
| Hot reload | Edit your application while it runs, with its state kept. |
| Gallery and hot reload | Browse components, edit them live, capture screenshots. |
| Contributing a component | Add a component, its test, its demo and its documentation. |
Look something up
| Page | Contents |
|---|---|
| Tokens | Every radius and duration, with defaults. |
| Components | Every component, by category, with its purpose. |
| Backend contract | Draw commands, events and fonts, for writing a renderer. |
| API reference | cargo doc -p limn --open lists every type and method. |
Conventions used in these pages
- Sizes are logical pixels. The backend applies the display’s scale factor.
- Durations are milliseconds.
- “The host” is the application that owns a
UiTree. - Code samples assume
use limn::*;unless they show their own imports.