Stk.Flex
Flex container widget.
val inter_space : int Props.prop
Property to specify the size of space between two items.
val wrap : bool Props.prop
Property "flex_wrap"
to specify whether lines can be wrapped when they don't fit.
val wrap_on_break : bool Props.prop
Property "flex_wrap_on_break"
to specify whether a line is broken when a `Break
item is encountered.
val collapse_spaces : bool Props.prop
Property "flex_collapse_spaces"
to specify whether `Space
items must be collapsed.
val expand : int Props.prop
Property "flex_item_expand"
to specify how an item must expand. A value higher than the other items on the same line will give more space to this item.
Item kind indicates how to handle an item:
`Break
indicates a break of line, which can be considered as space or real break, depending on the wrap_on_break
property,`Block
indicates that this item must be arranged alone on a line,`Item
indicates that this item is "normal" and can be arranged inline,`Space b
indicates that this item is a space in arrangement algorithm. b = true
is used internally to indicate that this space must be taken into account when computing coordinates.val item_kind : item_kind Props.prop
"flex_item_kind"
property. Default value is `Item
.
Justification of items:
`Start
aligns items on the left in horizontal flex, on top in vertical flex.`End
aligns items on the right in horizontal flex, on bottom in vertical flex.`Center
centers items #CaptainObvious.`Space_around
distributes spaces at the beginning of line, between items and at the end of line.`Space_betwwen
distributes spaces between items, leaving no space at the beginning and the end of the line.`Justified
is like `Space_between
except that the last line is justified as `Start
(like a regular text paragraph).val justification : justification Props.prop
"flex_justification"
property. Default value is `Start
.
val items_alignment : item_alignment Props.prop
"flex_items_alignment"
property. Default is `Baseline
.
val content_alignment : content_alignment Props.prop
"flex_content_alignment"
property. Default is `Stretch
.
Create a space
item with correct item_kind
value. See widget_arguments
for arguments.
Create a space
item with `Break
for item_kind
property. Default class_
is "flex_break"
. See widget_arguments
for arguments.
val flex :
?class_:string ->
?name:string ->
?props:Props.t ->
?orientation:Props.orientation ->
?justification:justification ->
?items_alignment:item_alignment ->
?content_alignment:content_alignment ->
?inter_space:int ->
?wrap:bool ->
?wrap_on_break:bool ->
?collapse_spaces:bool ->
?pack:(Widget.widget -> unit) ->
unit ->
'a flex
Convenient function to create a flex
. Optional arguments:
orientation
specifies horizontal or vertical packing. Default is Props.orientation.Horizontal
.justification
, items_alignment
, content_alignment
, inter_space
, wrap
, wrap_on_break
and collapse_spaces
are used to set the corresponding properties.See widget_arguments
for other arguments.