Expand description
Create html attributes
Structs
A generic sized representation of a function that can be attached to a Node. The callback will essentially be owned by the element
The Attributes partition into 4 different types
css styles style can be converted into an attribute
Enums
Values of an attribute can be in these variants
Wraps different primitive variants used as values in html This is needed since html attributes can have different value types such as checked(bool), name(String), tab_index(i32)
Traits
Special Node attributes that are treated differently such as key and skip which both greatly affects the diffing algorithm
Functions
Creates html accept-charset attribute
a utility function to convert simple value into attribute
A helper function for setting attributes with no values such as checked in checkbox input type This is best called to be appended to the node since this returns an array of attributes which doesn’t play well with the others
Creates html autocapitalize attribute
Creates html autocomplete attribute
Creates html background attribute
set the checked value, used checkbox and radio buttons
return a class attribute where the classnames are transformed with namespace
a helper function to add multiple classes to a node
A helper function which takes an array of tuple of class and a flag. The final class is assembled using only the values that has a flag which evaluates to true.
return a class namespaced with flag
Creates html contenteditable attribute
Creates html contextmenu attribute
Creates html crossorigin attribute
set whether an element is disabled or not
a utility function to return create an empty attr, useful for cases where branch expression need to return an attribute which otherwise it can not produce example:
Creates html enterkeyhint attribute
Creates html flex-direction attribute
focus the html element
Creates html font-family attribute
Creates html formaction attribute
Creates html formnovalidate attribute
Creates html importance attribute
set the inner html of this element without comparing in the diff this always sets the value This is for optimization purposes and will lead to some hacks in the implementation
Creates html intrinsicsize attribute
key attributes is used to match old element and new element when diffing
Set the attribute of this element if value is Some, empty attribute otherwise
Creates html novalidate attribute
Creates html placeholder attribute
Creates html radiogroup attribute
Creates html referrerpolicy attribute
if the value is true, then this node is made to replace the old node it matches
if the value is true, then the diffing of this element and its descendants are skip entirely
Creates html spellcheck attribute
create a style attribute
A helper function which creates a style attribute by assembling the tuples into a string for the style value.
A helper function which creates a style attribute by assembling only the parts that passed the boolean flag.
A helper function to build styles by accepting pairs