dioxus_lib::prelude::global_attributes

Constant id

source
pub const id: (&'static str, Option<&'static str>, bool);
Expand description

https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id

§Usage in rsx

let id = "value";

rsx! {
    // Attributes need to be under the element they modify
    div {
        // Attributes are followed by a colon and then the value of the attribute
        id: "value"
    }
    div {
        // Or you can use the shorthand syntax if you have a variable in scope that has the same name as the attribute
        id,
    }
};