dioxus_html::elements

Module switch

Source
Expand description

Build a <switch> element.

§Usage in rsx

rsx! {
    // Elements are followed by braces that surround any attributes and children for that element
    switch {
        // Add any attributes first
        color: "red",
        "custom-attribute-name": "value",
        // Then add any attributes you are spreading into this element
        ..attributes,
        // Then add any children elements, components, text nodes, or raw expressions
        circle { cx: "10", cy: "10", r: "2", fill: "red" }
        ChildComponent {}
        "child text"
        {raw_expression}
    }
};

Constants§