Crate yew_macro

source ·
Expand description

This crate provides Yew’s procedural macro html! which allows using JSX-like syntax for generating html and the Properties derive macro for deriving the Properties trait for components.

use yew::prelude::*;

struct Component;

#[derive(Properties, PartialEq)]
struct Props {
    prop: String,

// ...

html! {
    <button onclick={|_| Msg::Submit)}>
      { "Submit" }
      <Component prop="first" />
      <Component prop="second" />

Please refer to for how to set this up.


Attribute Macros

Derive Macros