For developers
Build something with libLuna.
One dependency, one window, a scene graph and 77 widgets following the immediate model. These docs take you from the first run(...) to a custom theme and a custom component — without GTK, Qt or GObject.
Four paths
You do not have to read everything in order. Pick what you need right now — every page ends with a link to the next step.
Quick start
From cargo run to a window that reacts to clicks. Dependency, AppConfig, Frame and the first drawing.
Widget library
77 components with real previews, categories, descriptions and copyable code examples.
Browse widgets →Themes & tokens
Colours, accents, typography and control metrics. Change the look without rewriting widgets.
See tokens →API index
A searchable list of public types, functions and methods across all six libLuna crates.
Search the API →The smallest working program
This is enough to open a window, paint the background and draw text. Everything else is an extension of the same contract.
use libluna::prelude::*;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = AppConfig::new("My app").initial_size(800, 600);
run(config, |frame: &mut Frame| {
let theme = frame.theme;
let (w, h) = (frame.size.width, frame.size.height);
frame.scene.fill_rect(
Rect::from_xywh(0.0, 0.0, w, h),
theme.colors.window_bg,
);
frame.scene.text(
TextRun::new(Point::new(24.0, 64.0), "Hello, Luna", 24.0)
.with_color(theme.colors.text)
.with_weight(700),
);
})
}
Full example with event handling: Quick start → first event.
What is what
The libluna facade bundles six crates into one entry point. Applications almost always use only the facade and its prelude.
libluna facade
Re-exports every layer and the prelude. The only dependency a typical app needs.
libluna-core foundation
Point, Rect, Color, events, theme, tokens and appearance settings.
libluna-render drawing
Scene graph, text, SVG icons and the CPU backend (tiny-skia + fontdue).
libluna-platform windows
xdg-shell windows, wlr-layer-shell panels, input, clipboard and the event loop.
libluna-widgets components
77 immediate widgets: paint + *_at, with a retained layout tree on top.
libluna-i18n languages
.lang files, locale detection, tr(...) and the t! macro.
Dependencies only point downwards: widgets do not know how DRM works, and the platform does not know how a button is painted. Details: Architecture.
Status today
Working: CPU rendering, Wayland windows, input, light/dark/auto themes, 9 accents, i18n, measure/allocate layout, 77 widgets and the complete Luna shell.
Not yet: GPU/dmabuf backend, IME, full HiDPI and AT-SPI accessibility. The API may change before 0.1 — each crate is versioned separately.