Module Unicorn_jsoo.A

HTML attributes and properties.

We don't differentiate betwen children nodes and attributes/properties. The attributes specified inside an HTML node attach to their closest parent node:

H.div ( ... & A.class_ (fun _ -> "foo") & ... )

will produce the HTML <div class="foo">...</div>

val id : ( 'a -> string ) -> 'a t
val class_ : ( 'a -> string ) -> 'a t
val style : ( 'a -> string ) -> 'a t
val for_ : ( 'a -> string ) -> 'a t
val disabled : ( 'a -> bool ) -> 'a t
val tabindex : ( 'a -> int ) -> 'a t
val placeholder : ( 'a -> string ) -> 'a t
val autofocus : ( 'a -> bool ) -> 'a t

Unsafe

Consider submitting a PR if you find yourself using this!

val make_string : string -> ( 'a -> string ) -> 'a t

make_string attr value attaches an attribute/property to its HTML parent node.

val make_int : string -> ( 'a -> int ) -> 'a t

make_int attr value attaches an integer attribute/property to its HTML parent node.

val make_bool : string -> ( 'a -> bool ) -> 'a t

make_string attr value attaches a boolean attribute/property to its HTML parent node.