package html_of_jsx

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
module Attribute : sig ... end
type node = {
  1. tag : string;
  2. attributes : Attribute.t list;
  3. children : element list;
}
and element =
  1. | Null
  2. | Text of string
  3. | Fragment of element list
  4. | Node of node
  5. | Component of unit -> element
  6. | List of element list

The type that represents a Jsx.element, it's a recursive type that allows to represent any HTML structure

val text : string -> element

Helper to represent an element as a string

val null : element

Helper to represent nullability in Jsx, useful to pattern match

val int : int -> element

Helper to render an integer (uses string_of_int)

val float : float -> element

Helper to render an integer (uses string_of_float)

val list : element list -> element
val fragment : element list -> element

Fragment

val node : string -> Attribute.t list -> element list -> element

The function to create a HTML DOM Node https://developer.mozilla.org/en-US/docs/Web/API/Node. Given the tag, list of attributes and list of childrens

OCaml

Innovation. Community. Security.