Skip to main content

Flex

Properties

PropertyTypeOptionalDescription
verticalbooleanyesThe direction of the flex
wrapbooleanyesAuto wrap line
justifyflex-start, center, flex-end, space-between, space-around, space-evenlyyesThe alignment of the elements, x axis
alignflex-start, center, flex-endyesThe alignment of the elements, y axis
gapsmall, middle, large, string, numberyesThe gap between grips
[events]functionyesPlease read the events page

Examples can be seen here

Children

Can have children.

Exmaple

local b1 = AM:createElement("Button", {
text = "Hello, World!",
icon = "AimOutlined",
})

local b2 = AM:createElement("Button", {
type = "link",
text = "Hello, World!",
})

local f1 = AM:createElement("Flex", {
width = "100%",
height = "100%",
}, {
b1,
b2
})

This is how it looks in-game:

Showcase

Vertical

When true the direction of the flex changes to vertical display instead of horizontal.

Showcase

Wrap

When true, the content will automaticly be wrapped.

Showcase

Justify

Sets the alignment of elements in the x-axis.

flex-start center flex-end space-between space-around space-evenly

Align

Sets the alignment of elements in the y-axis.

flex-start center flex-end

Gap

Sets the gap between elements.

small, middle, large are preset that can be used.

But can be any css, and when its a number its defaulting to pixels.

small middle large 100px