package virtual_dom

  1. Overview
  2. Docs
OCaml bindings for the virtual-dom library

Install

Dune Dependency

Authors

Maintainers

Sources

virtual_dom-v0.15.0.tar.gz
sha256=c32029907c0667369a500091533e2121c050e2392cfae7f07f2289e87c797390

doc/virtual_dom.input_widgets/Vdom_input_widgets/Button/index.html

Module Vdom_input_widgets.Button

val simple : ?extra_attrs:Virtual_dom.Vdom.Attr.t list -> ?disabled:bool -> string -> on_click:(unit -> unit Virtual_dom.Vdom.Effect.t) -> Virtual_dom.Vdom.Node.t

Though simple is fairly trivial, it is provided as a convenient parallel to with_validation

val with_validation : ?extra_attrs:Virtual_dom.Vdom.Attr.t list -> string -> validation:('a, string) Core.Result.t -> on_click:('a -> unit Virtual_dom.Vdom.Effect.t) -> Virtual_dom.Vdom.Node.t

Takes a ('a, string) Result.t that is typically the result of some validation performed incrementally. If the validation failed, the button will be disabled and will show a tooltip on hover with the error reason. If the validation is ok, the 'a is passed to the on_click handler. You can compose multiple validity checks with the Result applicative interface.

OCaml

Innovation. Community. Security.