package virtual_dom
OCaml bindings for the virtual-dom library
Install
Dune Dependency
Authors
Maintainers
Sources
v0.17.0.tar.gz
sha256=812711b4d5ce634a413580cd7096482de8d71abec9ae37bb01f7c0dcec2968ec
doc/virtual_dom.input_widgets/Vdom_input_widgets/Button/index.html
Module Vdom_input_widgets.Button
Source
Source
val simple :
?extra_attrs:Virtual_dom.Vdom.Attr.t list ->
?disabled:bool ->
?merge_behavior:Merge_behavior.t ->
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
Source
val with_validation :
?extra_attrs:Virtual_dom.Vdom.Attr.t list ->
?merge_behavior:Merge_behavior.t ->
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.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>