#[widget]Expand description
Attribute macro that generates a full impl Widget (and impl Renderable)
forwarding the structural / propagation method surface to a base field,
so a compound widget can “inherit” from a container without hand-forwarding
all ~63 delegated Widget methods.
This is the first-class replacement for the deprecated declarative
delegate_widget_to! / delegate_widget_method! macros.
§Usage
ⓘ
#[widget(base = VerticalGroup)]
#[derive(Reactive)]
struct StatCard {
base: VerticalGroup,
#[reactive] count: i32,
}§Options
base = <Type>(required) — the container type being “inherited”.field = <ident>— delegate to a differently-named field (defaultbase).style_type = "Name"— emit a custom CSS type; otherwise the widget’s own concrete type name is used (NOT the base’s).reactive— routereactive_widgettoSome(self)(opt-in for#[derive(Reactive)]compound widgets).override(m1, m2, ..)— do not forward these methods; call the user’s inherent method of the same name/signature instead.