Byo_toplayer_private_vdommodule Position = Byo_toplayer_private_floating.Positionmodule Alignment = Byo_toplayer_private_floating.Alignmentmodule Offset = Byo_toplayer_private_floating.Offsetmodule Match_anchor_side = Byo_toplayer_private_floating.Match_anchor_sidemodule Restore_focus_on_close : sig ... endDo not use this library directly! Use Byo_toplayer instead.
This library contains vdom utils for creating and positioning popovers, tooltips, and modals.
Note that the DOM for all popovers will be placed outside of the app root. If you want global event listeners (including keyboard shortcuts) to work inside popovers, they should be set via Vdom.Attr.Global_listeners. Similarly, global styles should be set using the :root pseudo-class, and Inline_css.Private.Dynamic.attr.
The optional arrow argument allows automatically positioning an "arrow" element to point towards the center of the floating element's anchor.
https://floating-ui.com/docs/arrow
Arrows will be automatically placed along the correct edge of the floating element, and rotated so that the "top" of the provided arrow points towards the anchor.
val tooltip :
?tooltip_attrs:Virtual_dom.Vdom.Attr.t list ->
?position:Position.t ->
?alignment:Alignment.t ->
?offset:Offset.t ->
?show_delay:Core.Time_ns.Span.t ->
?hide_grace_period:Core.Time_ns.Span.t ->
?hoverable_inside:bool ->
?light_dismiss:bool ->
?arrow:Virtual_dom.Vdom.Node.t ->
Virtual_dom.Vdom.Node.t ->
Virtual_dom.Vdom.Attr.tReturns an attr which, when attached to a Vdom node, will create a tooltip attached to that node. The tooltip will open/close on hover in/out, subject to show_delay and hide_grace_period. If hoverable_inside is set, the tooltip will not disappear if the cursor is moved inside it within hide_grace_period. If light_dismiss (default: true), the tooltip will close on click outside, escape, or if other tooltips with light_dismiss:true open.
val popover :
?popover_attrs:Virtual_dom.Vdom.Attr.t list ->
?position:Position.t ->
?alignment:Alignment.t ->
?offset:Offset.t ->
?match_anchor_side_length:Match_anchor_side.t ->
?restore_focus_on_close:Restore_focus_on_close.t ->
?overflow_auto_wrapper:bool ->
?arrow:Virtual_dom.Vdom.Node.t ->
Virtual_dom.Vdom.Node.t ->
Virtual_dom.Vdom.Attr.tReturns an attr which, when attached to a Vdom node, will create a popover positioned relative to that node. The popover's visibility should be controlled by attaching / detaching the attr to/from the anchor; the browser-level `showPopover()` and `hidePopover()` functions should not be used. This allows us to own the state controlling popover visibility.
module For_byo_toplayer : sig ... endmodule For_testing_popover_hook : sig ... endmodule For_testing_tooltip_hook : sig ... endmodule For_testing_byo_toplayer : sig ... endmodule For_jsdom_tests : sig ... end