2.0 KiB
2.0 KiB
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
| Property | Type | Default | Description |
|---|---|---|---|
| flexDirection | string | "row" | The direction of the flexbox layout "row" or "column" |
| flexSpacing | number | 1 | The spacing between flex items |
| flexJustifyContent | string | "flex-start" | The alignment of flex items along the main axis |
| flexAlignItems | string | "flex-start" | The alignment of flex items along the cross axis |
| flexCrossPadding | number | 0 | The padding on both sides of the cross axis |
| flexWrap | boolean | false | Whether to wrap flex items onto multiple lines |
Functions
| Method | Returns | Description |
|---|---|---|
| Flexbox.new | Flexbox | Creates a new Flexbox instance |
| Flexbox:Flexbox | Flexbox | Initializes the Flexbox instance |
| Flexbox:Flexbox | Flexbox | Adds a child element to the flexbox |
| Flexbox:Flexbox | Flexbox | Removes a child element from the flexbox |
| Flexbox:Flexbox | Flexbox | Adds a new line break to the flexbox. |
| Flexbox:Flexbox | - | Renders the flexbox and its children |
Flexbox.new()
Returns
FlexboxobjectThe newly created Flexbox instance
Flexbox:Flexbox(props, basalt)
Parameters
propstableThe properties to initialize the element withbasalttableThe basalt instance
Returns
FlexboxselfThe initialized instance
Flexbox:Flexbox(element)
Adds a child element to the flexbox
Parameters
elementElementThe child element to add
Returns
FlexboxselfThe flexbox instance
Flexbox:Flexbox(element)
Parameters
elementElementThe child element to remove
Returns
FlexboxselfThe flexbox instance
Flexbox:Flexbox(self)
Adds a new line break to the flexbox
Parameters
selfFlexboxThe element itself
Returns
Flexbox