package bonsai

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
module Result : sig ... end
module Direction : sig ... end
module Alignment : sig ... end
val 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.