Module Fmlib_browser.HtmlSource

Virtual Dom

Primitives

Sourcetype 'msg t

Type of a virtual dom node potentially generating a message of type 'msg.

Sourceval text : string -> 'msg t

text str Create a text node.

Sourceval node : string -> 'msg Attribute.t list -> 'msg t list -> 'msg t

node tag attrs children

Create an html element with a tagname, a list of attributes and a list of children.

Sourceval node_ns : string -> string -> 'msg Attribute.t list -> 'msg t list -> 'msg t

node namespace tag attrs children

Like node, but creates the node within a namespace e.g. "http://www.w3.org/2000/svg" for svg elements.

Sourceval svg_node : string -> 'msg Attribute.t list -> 'msg t list -> 'msg t

svg_node tag attrs children

Create an svg element with a tagname, a list of attributes and a list of children. An svg element is a node in the namespace "http://www.w3.org/2000/svg".

Sourceval map : ('a -> 'b) -> 'a t -> 'b t

map f vdom

Map a virtual dom vdom creating messages of type 'a to a virtual dom creating messages of type 'b.

Sourceval keyed : string -> 'msg Attribute.t list -> (string * 'msg t) list -> 'msg t

keyed tag attrs children

Like node, but add a unique identifier to each child node. This makes adding, removing and modifying child nodes more efficient. The dom diffing algorithm compares child nodes with the same identifier.

Headers

Sourceval h1 : 'msg Attribute.t list -> 'msg t list -> 'msg t

h1 attrs children is equivalent to node "h1" attrs children.

Sourceval h2 : 'msg Attribute.t list -> 'msg t list -> 'msg t

h2 attrs children is equivalent to node "h2" attrs children.

Sourceval h3 : 'msg Attribute.t list -> 'msg t list -> 'msg t

h3 attrs children is equivalent to node "h3" attrs children.

Sourceval h4 : 'msg Attribute.t list -> 'msg t list -> 'msg t

h4 attrs children is equivalent to node "h4" attrs children.

Sourceval h5 : 'msg Attribute.t list -> 'msg t list -> 'msg t

h5 attrs children is equivalent to node "h5" attrs children.

Sourceval h6 : 'msg Attribute.t list -> 'msg t list -> 'msg t

h6 attrs children is equivalent to node "h6" attrs children.

Grouping Content

Sourceval div : 'msg Attribute.t list -> 'msg t list -> 'msg t

div attrs children is equivalent to node "div" attrs children.

Sourceval span : 'msg Attribute.t list -> 'msg t list -> 'msg t

span attrs children is equivalent to node "span" attrs children.

Sourceval pre : 'msg Attribute.t list -> 'msg t list -> 'msg t

pre attrs children is equivalent to node "pre" attrs children.

Sourceval p : 'msg Attribute.t list -> 'msg t list -> 'msg t

p attrs children is equivalent to node "p" attrs children.

Input

Sourceval button : 'msg Attribute.t list -> 'msg t list -> 'msg t

button attrs children is equivalent to node "button" attrs children.

Sourceval input : 'msg Attribute.t list -> 'msg t list -> 'msg t

input attrs children is equivalent to node "input" attrs children.

Sourceval label : 'msg Attribute.t list -> 'msg t list -> 'msg t

label attrs children is equivalent to node "label" attrs children.

Sourceval textarea : 'msg Attribute.t list -> 'msg t list -> 'msg t

textarea attrs children is equivalent to node "textarea" attrs children.

Sourceval select : 'msg Attribute.t list -> 'msg t list -> 'msg t

select attrs children is equivalent to node "select" attrs children.

Lists

Sourceval ol : 'msg Attribute.t list -> 'msg t list -> 'msg t

ol attrs children is equivalent to node "ol" attrs children.

Sourceval ul : 'msg Attribute.t list -> 'msg t list -> 'msg t

ul attrs children is equivalent to node "ul" attrs children.

Sourceval li : 'msg Attribute.t list -> 'msg t list -> 'msg t

li attrs children is equivalent to node "li" attrs children.