Skip to content

Layout and Alignment

Layout controls how elements are organized in space. Luna Park uses CSS layout principles, but in a visual interface.


Container and Children

Each element acts as a container block (parent) that can organize its children. Layout properties therefore apply to the parent, while alignment influences the position of children inside.

Screenshot of a container with multiple children

Layout Type

You can define the main layout mode of the element:

ModeDescription
BlockElements are placed one below the other.
InlineElements are displayed sequentially on a line.
FlexFlexible organization of children (direction, wrap, alignment).
GridGrid organization with defined columns and rows.

Flex and Grid modes are recommended for structuring complex interfaces.

Selection of Flex mode in the style panel

Alignment (in Flex or Grid mode)

Once a container is in Flex or Grid mode, several properties control the position of children:

PropertyDescription
DirectionDefines the display direction: row, column, row-reverse, column-reverse.
Justify ContentAligns children on the main axis (defined by Direction).
Align ItemsAligns children on the secondary axis.
GapSpace between children (horizontal and/or vertical).
WrapIndicates if elements should wrap to the next line when space is insufficient.
Flex container with direction, justify and align

Absolute Positioning

For cases requiring free placement (overlays, badges, tooltips), you can enable absolute positioning.

PropertyDescription
PositionSwitches the element to absolute or relative.
Top / Right / Bottom / LeftDefines the exact position within the parent.
Z-indexManages layering between elements.
Example of absolute positioning in Luna Park

Best Practices

  • Use Flex for simple layouts (bars, columns, lists).
  • Use Grid for complex structures (tables, dashboards).
  • Avoid absolute positioning except for specific UI cases.
  • Prefer gaps to manual margins for consistent responsive rendering.

Going Further

Luna Park relies on the same principles as CSS. If you want to deepen the logic behind these properties: