Skip to main content

Crate egui_cha_macros

Crate egui_cha_macros 

Source
Expand description

Procedural macros for egui-cha layout DSL

Provides a declarative syntax for composing layouts that integrates directly with ViewCtx.

§Example

ⓘ
use egui_cha_macros::cha;

fn view(model: &Model, ctx: &mut ViewCtx<Msg>) {
    cha!(ctx, {
        Col(spacing: 8.0) {
            ctx.ui.heading("Counter")
            Row {
                @house           // Icon shorthand
                @gear(20.0)      // Icon with size
            }
            Row {
                Button::primary("+").on_click(ctx, Msg::Increment)
            }
        }
    });
}

Macros§

cha
Main macro for declarative layout composition with ViewCtx