package incr_dom_interactive

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

Install

Dune Dependency

Authors

Maintainers

Sources

incr_dom_interactive-v0.14.0.tar.gz
md5=0307253bd42dd3de1ecd9fc773784a6d

README.md.html

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