Compose semantic HTML
use pliego_dom::{IntoView, View, el};
fn notice(title: &str, body: &str) -> View {
el("aside")
.attr("aria-labelledby", "notice-title")
.child(el("h2").id("notice-title").child(title.to_owned()))
.child(el("p").child(body.to_owned()))
.into_view()
}Text nodes and attribute values are escaped by the renderer. Structural names are validated at construction boundaries; raw HTML is never the default path.
Typed view macro
use pliego_macros::view;
let page = view! {
<main class="shell">
<h1>{title}</h1>
<p>{summary}</p>
</main>
};Use the builder for dynamic composition and view! for concise authored trees. Both produce the same View contract and deterministic HTML.
Useful HTML first
Navigation, content, forms, headings, landmarks, and essential controls belong in the authored document. Rust/WASM resumes owned behavior at explicit boundaries instead of reconstructing the page.
Mounted ownership
A mounted scope owns its reactive children, DOM listeners, adapter instances, cancellation handles, and cleanup. Unmounting the scope disposes the complete subtree.