Tw_html.AtFunctions for creating HTML attributes.
val id : string -> attrid "my-id" creates an id attribute.
val title : string -> attrtitle "My Title" creates a title attribute.
val lang : string -> attrlang "en" creates a lang attribute.
val dir : string -> attrdir "ltr" creates a dir attribute.
val tabindex : int -> attrtabindex 0 creates a tabindex attribute.
val contenteditable : bool -> attrcontenteditable true creates a contenteditable attribute.
val spellcheck : string -> attrspellcheck value sets the spellcheck attribute. Use "true" or "false".
val onclick : string -> attronclick "..." creates an onclick attribute.
val onchange : string -> attronchange "..." creates an onchange attribute.
val oninput : string -> attroninput "..." creates an oninput attribute.
val onsubmit : string -> attronsubmit "..." creates an onsubmit attribute.
val type' : string -> attrtype' "text/css" creates a type attribute.
val value : string -> attrvalue "..." creates a value attribute.
val name : string -> attrname "description" creates a name attribute.
val placeholder : string -> attrplaceholder "..." creates a placeholder attribute.
val required : attrThe required attribute.
val disabled : attrThe disabled attribute.
val checked : attrThe checked attribute.
val readonly : attrThe readonly attribute.
val href : string -> attrhref "/path" creates an href attribute.
val target : string -> attrtarget "_blank" creates a target attribute.
val rel : string -> attrrel "stylesheet" creates a rel attribute.
val download : string -> attrdownload "file.pdf" creates a download attribute.
val src : string -> attrsrc "/image.png" creates a src attribute.
val alt : string -> attralt "description" creates an alt attribute for images.
val width : int -> attrwidth 800 creates a width attribute.
val height : int -> attrheight 600 creates a height attribute.
val loading : string -> attrloading "lazy" creates a loading attribute.
val charset : string -> attrcharset "utf-8" creates a charset attribute.
val content : string -> attrcontent "..." creates a content attribute.
val property : string -> attrproperty "og:title" creates a property attribute.
val style : string -> attrstyle "color:red;" creates a style attribute.
val datetime : string -> attrdatetime "2025-07-28" creates a datetime attribute.
val srcset : string -> attrsrcset "..." creates a srcset attribute for responsive images.
val sizes : string -> attrsizes "..." creates a sizes attribute for responsive images.
val title' : string -> attrtitle' "My Page" creates a title attribute for elements.
val loading_lazy : attrThe loading="lazy" attribute.
val v : string -> string -> attrv key value creates a generic key-value attribute.
val void : attrvoid is an empty attribute that doesn't render.
val true' : string -> attrtrue' key creates a boolean attribute with a "true" value.
val false' : string -> attrfalse' key creates a boolean attribute with a "false" value.
if' cond at is at if cond is true, otherwise returns a void attribute.
val is_void : attr -> boolis_void at is true if the attribute is void (won't render).
val to_pair : attr -> string * stringto_pair at returns the attribute as a (name, value) pair.
val of_pair : (string * string) -> attrof_pair (n, v) creates an attribute from a (name, value) pair.
val accesskey : string -> attraccesskey key sets keyboard shortcut.
val action : string -> attraction url sets form action URL.
val autocomplete : string -> attrautocomplete value sets autocomplete behavior.
val autofocus : attrautofocus sets element to be focused on page load.
val cols : int -> attrcols n sets textarea columns.
val colspan : int -> attrcolspan n sets table cell column span.
val defer : attrdefer defers script execution.
val draggable : bool -> attrdraggable b sets whether element is draggable.
val for' : string -> attrfor' id associates label with form element.
hidden hides the element.
val list : string -> attrlist id associates input with datalist.
val method' : string -> attrmethod' m sets form HTTP method.
val media : string -> attrmedia query sets media query for resources.
val popover : string -> attrpopover value sets popover behavior.
val popovertarget : string -> attrpopovertarget id sets popover target element.
val popovertargetaction : string -> attrpopovertargetaction action sets popover action.
val rows : int -> attrrows n sets textarea rows.
val rowspan : int -> attrrowspan n sets table cell row span.
val selected : attrselected marks option as selected.
val wrap : string -> attrwrap mode sets textarea wrap mode.
val fill_rule : [ `evenodd ] -> attrfill_rule `evenodd sets the fill rule
val clip_rule : [ `evenodd ] -> attrclip_rule `evenodd sets the clipping rule
val cx : int -> attrcx n sets the center x coordinate
val cy : int -> attrcy n sets the center y coordinate
val r : int -> attrr n sets the radius
val view_box : string -> attrview_box "0 0 20 20" sets the viewBox
val fill : string -> attrfill "currentColor" sets the fill color
val stroke : string -> attrstroke "currentColor" sets the stroke color
val stroke_width : string -> attrstroke_width "2" sets the stroke width
val stroke_linecap : string -> attrstroke_linecap "round" sets the stroke line cap
val stroke_linejoin : string -> attrstroke_linejoin "round" sets the stroke line join
val x : string -> attrx "10" sets the x coordinate
val y : string -> attry "10" sets the y coordinate
val rx : string -> attrrx "5" sets the x radius for rounded rectangles
val d : string -> attrd "M10 10 L20 20" sets the path data
val x1 : string -> attrx1 "0" sets the first x coordinate
val y1 : string -> attry1 "0" sets the first y coordinate
val x2 : string -> attrx2 "20" sets the second x coordinate
val y2 : string -> attry2 "20" sets the second y coordinate