package bonsai

  1. Overview
  2. Docs
A library for building dynamic webapps, using Js_of_ocaml

Install

Dune Dependency

Authors

Maintainers

Sources

bonsai-v0.16.0.tar.gz
sha256=1d68aab713659951eba5b85f21d6f9382e0efa8579a02c3be65d9071c6e86303

doc/bonsai.web_ui_popover/Bonsai_web_ui_popover/index.html

Module Bonsai_web_ui_popoverSource

Sourcemodule Result : sig ... end
Sourcemodule Direction : sig ... end
Sourcemodule Alignment : sig ... end
Sourceval component : ?popover_extra_attr:Bonsai_web.Vdom.Attr.t Bonsai_web.Value.t -> ?popover_style_attr:Bonsai_web.Vdom.Attr.t Bonsai_web.Value.t -> ?allow_event_propagation_when_clicked_outside: ([ `Left_click | `Right_click | `Escape ] -> bool) Bonsai_web.Value.t -> ?on_close:unit Bonsai_web.Effect.t Bonsai_web.Value.t -> close_when_clicked_outside:bool -> direction:Direction.t Bonsai_web.Value.t -> alignment:Alignment.t Bonsai_web.Value.t -> popover: (close:unit Bonsai_web.Effect.t Bonsai_web.Value.t -> Bonsai_web.Vdom.Node.t Bonsai_web.Computation.t) -> unit -> Result.t Bonsai_web.Computation.t

Popover's are similar to tooltips, but they can contain arbitrary state of their own, you can also control when they open rather than opening by default when hovering. The "base" of the component is the element that is always there. The "popover" itself is the element that pops out when then open_ effect is scheduled. You have full control over the creation of the "base" element by the function that is given to the popover. The popover element that you create through the popover function is later wrapped around another div to handle the "hovering" styles for you. You can attach extra attrs to this element through popover_extra_attr. The popover element itself also has some default styling of its own which you can override using popover_style_attr.

close_when_clicked_outside, when set to true, will close the popover if a click occurs outside of the popover.

OCaml

Innovation. Community. Security.