Module Unicorn_jsoo.H

HTML elements and nodes, like div, span, etc.

We don't check that the HTML elements are used correctly!

By convention, when the following functions takes an 'a t list for their children, then they must only be passed attributes (and not children nodes).

val a : 'a t -> 'a t
val div : 'a t -> 'a t
val h1 : 'a t -> 'a t
val h2 : 'a t -> 'a t
val h3 : 'a t -> 'a t
val h4 : 'a t -> 'a t
val h5 : 'a t -> 'a t
val h6 : 'a t -> 'a t
val hr : 'a t list -> 'a t
val label : 'a t -> 'a t
val li : 'a t -> 'a t
val p : 'a t -> 'a t
val pre : 'a t -> 'a t
val span : 'a t -> 'a t
val ul : 'a t -> 'a t
val section : 'a t -> 'a t
val header : 'a t -> 'a t
val button : 'a t -> 'a t
val input_string : ( 'a, string ) Optic.lens -> 'a t list -> 'a t
val checkbox : ( 'a, bool ) Optic.lens -> 'a t list -> 'a t

Unsafe

Consider submitting a PR if you find yourself using this!

val make : string -> 'a t -> 'a t

make name children creates a new HTML node with tag name and children.

val leaf : string -> 'a t list -> 'a t

leaf name attrs creates a new HTML element with tag name and a list of optional attributes (no children nodes).