A blazing fast type-checked HTML macro crate.
- Type checking for element names/attributes
#![no_std]
support- Automatic escaping
- Extremely fast, using lazy rendering by default to avoid unnecessary allocations
- Support for two well-known HTML macro syntaxes,
maud
andrsx
#![forbid(unsafe_code)]
across the entire codebase- Integration with all major web frameworks, enabled by their respective feature flags
- vidhan.io (my website!)
Make a pull request to list your project here!
use hypertext::prelude::*;
let shopping_list = ["milk", "eggs", "bread"];
let shopping_list_maud = maud! {
div {
h1 { "Shopping List" }
ul {
@for (i, item) in (1..).zip(shopping_list) {
li.item {
input #{ "item-" (i) } type="checkbox";
label for={ "item-" (i) } { (item) }
}
}
}
}
}
.render();
// or, alternatively:
let shopping_list_rsx = rsx! {
<div>
<h1>Shopping List</h1>
<ul>
@for (i, item) in (1..).zip(shopping_list) {
<li class="item">
<input id={ "item-" (i) } type="checkbox">
<label for={ "item-" (i) }>(item)</label>
</li>
}
</ul>
</div>
}
.render();