Skip to content

FlexBox

This is the FlexBox class. It is a container that arranges its children in a flexible layout.The flexbox element adds the following properties to its children:

Extends: Container

Properties

PropertyTypeDefaultDescription
flexDirectionstring"row"The direction of the flexbox layout "row" or "column"
flexSpacingnumber1The spacing between flex items
flexJustifyContentstring"flex-start"The alignment of flex items along the main axis
flexAlignItemsstring"flex-start"The alignment of flex items along the cross axis
flexCrossPaddingnumber0The padding on both sides of the cross axis
flexWrapbooleanfalseWhether to wrap flex items onto multiple lines

Functions

MethodReturnsDescription
FlexBox:addChildFlexBoxAdds a child element to the flexbox
FlexBox:addLineBreakFlexBoxAdds a new line break to the flexbox.

FlexBox:addChild(element)

Adds a child element to the flexbox

Parameters

  • element Element The child element to add

Returns

  • FlexBox self The flexbox instance

FlexBox:addLineBreak(self)

Adds a new line break to the flexbox

Parameters

  • self FlexBox The element itself

Returns

  • FlexBox

Released under the MIT License.