Grid Layout¶
Description¶
Arranges items in a precise 2D grid. Items can flow naturally into the next available space or be pinned to specific coordinates.
Configuration¶
grid: # columns: 24 # default grid width; set to change it items: - item: item_1 - item: item_2
Grid Options¶
| Field | Type | Description |
|---|---|---|
columns |
number | Number of vertical columns (default: 24) |
items |
list | The items to place in the grid |
Grid rows size to their content, and every item spans one column and one row unless it says otherwise. Spacing between cells is set by style.layout.grid.gap, in pixels.
Item Options¶
Grid items support specific positioning properties:
| Field | Type | Description |
|---|---|---|
col |
number | Starting column index (0-based) |
row |
number | Starting row index (0-based) |
col_span |
number | Number of columns to span (default: 1) |
row_span |
number | Number of rows to span (default: 1) |
Clear naming
We use col_span and row_span instead of width and height to avoid confusion with pixel dimensions.
Behavior¶
- Auto-Flow: Items without
colandroware placed automatically in the next available space. - Pinned: Items with
colandroware fixed to that position. - Overlap: Pinned items can overlap other items.
Example¶
grid: items: # Top Row: 3 KPIs (8 columns each) - col_span: 8 item: kpi_1 - col_span: 8 item: kpi_2 - col_span: 8 item: kpi_3 # Middle: Main Chart (16 cols) + List (8 cols) - col_span: 16 row_span: 4 item: main_chart - col_span: 8 row_span: 4 item: recent_activity_list