libLuna Documentation
PL EN
GitHub

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.

Loading…

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.

rust · usage pattern
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.

  • Carousel = Pager
  • ScrolledWindow = ScrollView
  • StackSwitcher = ViewSwitcher
  • Notebook = TabView
  • ListBox = NavList

Where to find details