| Crates.io | yo-html |
| lib.rs | yo-html |
| version | 0.1.1 |
| created_at | 2024-03-13 14:23:41.920994+00 |
| updated_at | 2025-09-11 12:33:22.461173+00 |
| description | JSX-like macro similar to what you can find in React or Yew but without framework nor trait. |
| homepage | https://github.com/cecton/yo-html |
| repository | https://github.com/cecton/yo-html |
| max_upload_size | |
| id | 1171722 |
| size | 125,199 |
JSX-like macro similar to what you can find in React or Yew but without framework nor trait.
let name = "Tippsie";
let class = "class";
let onclick = todo!();
let dynamic_attribute = "style";
html! {
<> // Support fragments
<div class="important">{"Hello "}<strong>{name}</strong></div>
<ul class=["list", "of", class]>
<li><button {onclick}>{"Click here"}</button></li>
<li {dynamic_attribute}="color:red"></li>
<li>("%x", 42)</li> // Shorthand for: format_args!("%x", 42)
</ul>
</>
}
An example of web framework is provided in the examples directory but you
need to make your own for this macro to be usable.