Why incr_dom?

Declarative, Optimizable Web UIs

Inspired by React and Elm, Incr_dom allows developers to specify the view of their apps declaratively.

What sets Incr_dom apart is its integration with Incremental, an optimization framework for building computations that adapt quickly to changes to their inputs.

Incr_dom’s use of Incremental makes it easy to incrementally compute all sorts of data transformations within your UI. This is especially useful for building UIs that display views derived from large, dynamically changing datasets.

open Core_kernel
open Async_kernel
open Incr_dom

module Model = struct
  type t = unit
  let cutoff _ _ = true

module State = struct
  type t = unit

module Action = struct
  type t = Nothing.t [@@deriving sexp]

let initial_model = ()
let on_startup ~schedule_action:_ _model = 

let create model ~old_model:_ ~inject:_ =
  let open Incr.Let_syntax in
  let%map model = model in
  let apply_action action _ ~schedule_action:_ = 
    Nothing.unreachable_code action in
  let view = Vdom.Node.text "hello world" in
  Component.create ~apply_action model view

Getting Started


$ opam install incr_dom

See here for incr_dom’s opam package file.


More docs, including detailed API docs, are available here.

Example applications can be found on Github.