package virtual_dom
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=7f1fa83287458114c5b0cab8aae00d69972d15e1d20a446ce13f246aacef3216
doc/virtual_dom.layout/Vdom_layout/index.html
Module Vdom_layout
Source
module Attr := Virtual_dom.Vdom.Attr
module Node := Virtual_dom.Vdom.Node
If node is an Element, do nothing other than returning that Element. Otherwise put a div around the node and return the div's Element.
Change the style attribute of a node. Calls wrap_in_element_if_necessary
.
val as_box :
[ `Row | `Column ] ->
?gap:Css_gen.Length.t ->
?align_items:Css_gen.item_alignment ->
node_creator ->
node_creator
Turn a node_creator into a node_creator that sets the style information on the node to be a flexbox. We also set the flex attribute flex-shrink to 0 if it isn't set (but we leave it alone if it happens to be set).
val as_hbox :
?gap:Css_gen.Length.t ->
?align_items:Css_gen.item_alignment ->
node_creator ->
node_creator
val as_vbox :
?gap:Css_gen.Length.t ->
?align_items:Css_gen.item_alignment ->
node_creator ->
node_creator
Make this a child of a flexbox that can scroll (e.g. if its content is bigger than the size given to it by the parent container, scrollbars will appear)
Convenience wrapper same as as_hbox Node.div
.
Convenience wrapper same as as_vbox Node.div
.
val spacer :
?attrs:Attr.t list ->
?min_width:Css_gen.Length.t ->
?min_height:Css_gen.Length.t ->
unit ->
Node.t
a blank div element
val body :
?direction:[ `Row | `Column ] ->
?gap:Css_gen.Length.t ->
?align_items:Css_gen.item_alignment ->
node_creator
box (default direction=`Column), width = 100vh, height = 100vh
val modal :
?direction:[ `Row | `Column ] ->
?gap:Css_gen.Length.t ->
?align_items:Css_gen.item_alignment ->
node_creator
Display nodes (layouted as a box) in a smaller window on top of everything else (with everything else grayed out and inaccessible via the mouse). Note that this renders a border but no control elements (not even a button to close the window)