Attribute

:= [Attribute(Str, Str)]

Construct HTML attributes for use with Html.

Attribute values are escaped when rendered. Attribute names passed to attribute are emitted as HTML syntax and must be trusted constants, not user input.

attribute : Str, Str -> Attribute

Construct an attribute with a trusted HTML name and an arbitrary value.

raw_name : Attribute -> Str

Return the attribute name exactly as supplied.

raw_value : Attribute -> Str

Return the unescaped attribute value exactly as supplied.

class : Str -> Attribute

Set the HTML class attribute.

id : Str -> Attribute

Set the HTML id attribute.

href : Str -> Attribute

Set the HTML href attribute.

src : Str -> Attribute

Set the HTML src attribute.

rel : Str -> Attribute

Set the HTML rel attribute.

name : Str -> Attribute

Set the HTML name attribute.

width : Str -> Attribute

Set the HTML width attribute.

height : Str -> Attribute

Set the HTML height attribute.

style : Str -> Attribute

Set the HTML style attribute.

type : Str -> Attribute

Set the HTML type attribute.

value : Str -> Attribute

Set the HTML value attribute.

role : Str -> Attribute

Set the HTML role attribute.

for_ : Str -> Attribute

Set the HTML for attribute. The trailing underscore avoids the Roc keyword.

action : Str -> Attribute

Set the HTML form action attribute.

method : Str -> Attribute

Set the HTML form method attribute.

min : Str -> Attribute

Set the HTML min attribute.

max : Str -> Attribute

Set the HTML max attribute.

hidden : Str -> Attribute

Set the HTML hidden attribute.