package incr_dom_interactive

  1. Overview
  2. Docs
A monad for composing chains of interactive UI elements

Install

Dune Dependency

Authors

Maintainers

Sources

v0.15.1.tar.gz
sha256=523b9c27e5103717db4e40b43f8124da2863ab0273e6e1ef1ba8577b44a72523

Description

This library allows your program to receive input from the user using DOM elements such as checkboxes, text fields, and buttons. It allows you to inspect the user's input and decide afterwards what the rest of the [Interactive.t] should be. This library is intended to be used in conjunction with Incr_dom.

Published: 18 Oct 2022

README

Incr_dom_interactive

A monad for composing chains of interactive UI elements inside an Incr_dom application.

A form that only allows submission after 10 characters have been entered
let open Interactive.Let_syntax in
let open Interactive.Primitives in
let submit_button = button ~text:"Submit" () in
let%bind_open user_input = text () in
if String.length user_input < 10
then
  let%map_open () = message "Please enter at least 10 characters." in
  None
else
  match%map submit_button with
  | Not_pressed -> None
  | Pressed -> Some user_input

Dependencies (13)

  1. js_of_ocaml-ppx >= "3.9.0"
  2. js_of_ocaml >= "3.9.0"
  3. dune >= "2.0.0"
  4. virtual_dom >= "v0.15" & < "v0.16"
  5. splay_tree >= "v0.15" & < "v0.16"
  6. ppx_jane >= "v0.15" & < "v0.16"
  7. incremental >= "v0.15" & < "v0.16"
  8. incr_select >= "v0.15" & < "v0.16"
  9. incr_map >= "v0.15" & < "v0.16"
  10. incr_dom >= "v0.15" & < "v0.16"
  11. async_kernel >= "v0.15" & < "v0.16"
  12. async_js >= "v0.15" & < "v0.16"
  13. ocaml >= "4.08.0"

Dev Dependencies

None

Used by (1)

  1. incr_dom_sexp_form >= "v0.15.0" & < "v0.16.0"

Conflicts

None