package html_of_jsx

  1. Overview
  2. Docs

Module JsxSource

Sourcemodule Attribute : sig ... end
Sourcetype node = {
  1. tag : string;
  2. attributes : Attribute.t list;
  3. children : element list;
}
Sourceand 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

Sourceval text : string -> element

Helper to represent an element as a string

Sourceval null : element

Helper to represent nullability in Jsx, useful to pattern match

Sourceval int : int -> element

Helper to render an integer (uses string_of_int)

Sourceval float : float -> element

Helper to render an integer (uses string_of_float)

Sourceval list : element list -> element
Sourceval fragment : element list -> element

Fragment

Sourceval 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.