A library for building dynamic webapps, using Js_of_ocaml
Module type
Class type
Library bonsai.web_ui_element_size_hooks
module Behavior : sig ... end
val attr : ?behavior:Behavior.t -> unit -> Bonsai_web.Vdom.Attr.t

This hook is placed on a node, and that node will be resized to match the content-size of its parent. The different behaviors are as follows:

  • Grow_to_fill: The element will only grow to fill space. never shrink.
  • Shrink_to_avoid_overflow: The element will only shrink to avoid clipping out of its parents content. It will never grow.
  • Grow_or_shrink_to_match_parent_size: The node will grow or shrink to take up as much space as possible.

The default behavior is Shrink_to_avoid_overflow

It is recommended that you place these attributes on the parent of the node that is given attr.

Currently all this attribute does is set overflow: hidden, which prevents scrollbars from showing up on the parent node.