Skip to main content

Module elements

Module elements 

Source
Expand description

HTML5 semantic element builders.

This module provides type-safe builders for modern HTML5 semantic elements with built-in ARIA attribute support and accessibility validation.

§Examples

use html_generator::elements::{Article, Section, Nav, Aside, Template};

let nav = Nav::new()
    .aria_label("Main navigation")
    .id("main-nav")
    .child("<ul><li><a href=\"/\">Home</a></li></ul>")
    .build();
assert!(nav.contains("role=\"navigation\""));
assert!(nav.contains("aria-label=\"Main navigation\""));

Structs§

Article
Builder for <article> elements.
Aside
Builder for <aside> elements.
Nav
Builder for <nav> elements.
Section
Builder for <section> elements.
Template
Template for composing multiple semantic elements into a page structure.

Traits§

SemanticElement
Trait implemented by all semantic element builders.