Raxol.UI.Layout.Containers (Raxol v0.5.0)

View Source

Handles layout calculations for container elements like rows and columns.

This module is responsible for:

  • Row layout calculations
  • Column layout calculations
  • Flexbox-like distribution of space
  • Gap and alignment handling

Summary

Functions

Measures the space needed by a column element.

Measures the space needed by a row element.

Processes a column element, calculating layout for it and its children.

Processes a row element, calculating layout for it and its children.

Functions

measure_column(arg1, available_space)

Measures the space needed by a column element.

Parameters

  • column - The column element to measure
  • available_space - The available space for the column

Returns

The dimensions of the column: %{width: w, height: h}

measure_row(arg1, available_space)

Measures the space needed by a row element.

Parameters

  • row - The row element to measure
  • available_space - The available space for the row

Returns

The dimensions of the row: %{width: w, height: h}

process_column(arg1, space, acc)

Processes a column element, calculating layout for it and its children.

Parameters

  • column - The column element to process
  • space - The available space for the column
  • acc - The accumulator for rendered elements

Returns

A list of positioned elements with absolute coordinates.

process_row(arg1, space, acc)

Processes a row element, calculating layout for it and its children.

Parameters

  • row - The row element to process
  • space - The available space for the row
  • acc - The accumulator for rendered elements

Returns

A list of positioned elements with absolute coordinates.