functora-egui 0.4.2

shadcn/ui-inspired widget library for egui - buttons, inputs, selects, dialogs, and 70+ more components with light/dark theming
Documentation
//! Utility for centering content on both axes.

/// Centers content horizontally and vertically within all available space.
///
/// ```no_run
/// # egui::__run_test_ui(|ui| {
/// functora_egui::center(ui, |ui| {
///     ui.label("Centered!");
/// });
/// # });
/// ```
pub fn center<R>(
    ui: &mut egui::Ui,
    content: impl FnOnce(&mut egui::Ui) -> R,
) -> egui::InnerResponse<R> {
    super::flex::Flex::row()
        .justify_center()
        .align_center()
        .w_full()
        .h_full()
        .show(ui, |f| f.ui(content).inner)
}