Skip to main content

impl_props_builders

Macro impl_props_builders 

Source
macro_rules! impl_props_builders {
    ($widget:ty) => { ... };
}
Expand description

Generate builder methods for widgets with props: WidgetProps field.

This macro generates the following methods:

  • element_id(self, impl Into<String>) -> Self - Set CSS element ID
  • class(self, impl Into<String>) -> Self - Add a CSS class
  • classes(self, IntoIterator<Item=S>) -> Self - Add multiple CSS classes

§Example

struct MyWidget {
    props: WidgetProps,
}

impl_props_builders!(MyWidget);