package virtual_dom

  1. Overview
  2. Docs
type t =
  1. | Text of string
  2. | Element of {
    1. tag_name : string;
    2. attributes : (string * string) list;
    3. string_properties : (string * string) list;
    4. handlers : (string * Handler.t) list;
    5. key : string option;
    6. children : t list;
    }
  3. | Widget of string

Roughly analogous to Vdom.Node.t, but more easily inspectable and represented as a pure OCaml type.

val sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.t
val map : t -> f:(t -> [ `Continue | `Replace_with of t ]) -> t
val is_tag : tag:string -> t -> bool
val has_class : cls:string -> t -> bool
val select : t -> selector:string -> t list
val select_first : t -> selector:string -> t option
val select_first_exn : t -> selector:string -> t
val to_string_html : t -> string
val unsafe_convert_exn : Virtual_dom.Vdom.Node.t -> t
val trigger : ?extra_fields:(string * Js_of_ocaml.Js.Unsafe.any) list -> t -> event_name:string -> unit
module User_actions : sig ... end

Convenience functions for trigger, closely modeling user interactions.

OCaml

Innovation. Community. Security.