component

Attribute Macro component 

Source
#[component]
Expand description

Attribute macro for defining components with inline render function.

This is an alternative to the derive macro that allows defining the component and its render function in one place.

§Example

use openkit_macros::component;

#[component(selector = "greeting")]
fn Greeting(
    #[prop] name: String,
    #[prop(default = "Hello")] greeting: String,
) -> impl Widget {
    label!(format!("{}, {}!", greeting, name))
}