Library · 77 widgets
libLuna widgets
Everything you can paint and handle in one place: from Button and Entry to NavigationView, HeaderBar and dialogs. The previews are not mockups — they come from the real libLuna renderer in light and dark themes.
The shared contract
Every widget follows the same rhythm: paint draws, hit tests a point, and click_at or another *_at method returns the interaction result. Presentation state (hover, pressed, value, caret) belongs either to the widget struct or to the application.
let mut widget = Button::new("Save");
// 1. painting — no state change
let mut ctx = PaintCtx::new(scene, &theme, text);
widget.paint(&mut ctx, rect);
// 2. hit testing and reaction — decided by the application
if widget.click_at(rect, pointer) {
save();
}
Some widgets also take &Theme or &TextEngine (e.g. SplitButton::rects, TabBar::click_at). Full signatures are in the API index and rustdoc.
GTK4 / libadwaita-style aliases
If you come from GTK, some names will feel familiar. Aliases point to the same types — there are not two implementations.
The whole gallery at once
The same screen is available in the demo app (cargo run --manifest-path apps/luna-demo/Cargo.toml --bin gallery) and as an offline screenshot.
Where to find details
API index
Signatures of every public type and method, with source links.
Open API →Themes
How tokens change widget colours and geometry without rewriting them.
Tokens →The immediate model
Why a widget is not a tree node and what that means for state.
Concepts →Sources
Every widget is a single Rust file with tests. Read and copy freely.
GitHub →