bonsai
-
bonsai
-
-
bonsai.bench
-
bonsai.example_chat_open_source_native
-
bonsai.example_chat_open_source_native_common
-
-
bonsai.extra
-
-
bonsai.focus_ring
-
bonsai.protocol
-
bonsai.tailwind_colors
-
bonsai.test
-
bonsai.test.dot
-
bonsai.web_test
-
bonsai.web_ui_common_components
-
bonsai.web_ui_drag_and_drop
-
bonsai.web_ui_element_size_hooks
-
bonsai.web_ui_file
-
bonsai.web_ui_file_from_web_file
-
bonsai.web_ui_form
-
-
bonsai.web_ui_freeform_multiselect
-
bonsai.web_ui_multi_select
-
-
bonsai.web_ui_query_box
-
bonsai.web_ui_reorderable_list
-
bonsai.web_ui_typeahead
Library
Module
Module type
Parameter
Class
Class type
module Bounds : sig ... end
val on_change : ( Bounds.t -> unit Ui_effect.t ) -> Bonsai_web.Vdom.Attr.t
When the attribute returned from this function is attached to a dom node, the attribute tracks the visible region of the node in the browser.
E.g. when the node is visible fully, min_x = min_y = 0, and max_x = node's width, max_y = node's height.
The bounds is conservative; it may over-estimate the size, but will never underestimate the size. Over-estimation can occur when a parent of the tracked node has a more restrictive size than the tracked node such that a scrollbar is present.
This is mostly useful for large nodes, to implement some custom scrolling behaviour - if your browser has height 500px, and you have a node with height 1000px, the y bounds will be (0, 500) if scrolled to the top (so that the top of the node visible), than (50, 550) as you scroll 50 pixels down, etc.
module For_testing : sig ... end