Article Type: How-To / Tutorial
Audience: Application Designers, Dashboard Builders, Developers
Module: Screen Designer
Applies to Versions: All current versions
The Grid Container layout provides a powerful way to create structured, responsive dashboard layouts in Fuuz. Unlike the default Flex layout which arranges items in rows or columns, the Grid layout allows you to define a precise two-dimensional matrix of cells where components can be positioned and sized exactly where you need them.
This article explains how to:
Grid_Container_Demo_0_0_1.json). Import this screen into your application to experiment with the grid properties interactively.
| Aspect | Flex Layout | Grid Layout |
|---|---|---|
| Dimension | One-dimensional (row OR column) | Two-dimensional (rows AND columns) |
| Item Placement | Items flow sequentially | Items placed in specific cells |
| Sizing | Items sized by content or flex-grow | Cells have uniform size, items can span |
| Best For | Toolbars, menus, form rows | Dashboards, tile layouts, data displays |
layout: "grid" that defines the overall grid structure| Property | Type | Description |
|---|---|---|
layout |
String | Set to "grid" to enable grid layout |
columns |
Number | Number of columns in the grid (e.g., 5) |
rows |
Number | Number of rows in the grid (e.g., 5) |
justifyItems |
String | Horizontal alignment: "start", "center", "end", "stretch" |
{
"type": "Container",
"props": {
"layout": "grid",
"columns": 5,
"rows": 5,
"justifyItems": "center",
"width": "100%",
"height": "auto",
"margin": 1,
"background": "default"
}
}Items placed inside a Grid Container automatically flow into the grid cells from left to right, top to bottom. Each child component occupies one cell by default.
For a 5x5 grid (25 cells), if you add 25 buttons, they will fill the grid completely, one per cell.
Grid cells are filled in reading order (left-to-right, top-to-bottom):
5x5 Grid Cell Order:
Col1 Col2 Col3 Col4 Col5
---- ---- ---- ---- ----
1 2 3 4 5 ← Row 1
6 7 8 9 10 ← Row 2
11 12 13 14 15 ← Row 3
16 17 18 19 20 ← Row 4
21 22 23 24 25 ← Row 5
The order of child components in the component tree determines which cell they occupy.
When you need a component to occupy more than one cell (span multiple columns or rows), use the Grid Cell component.
| Property | Type | Description |
|---|---|---|
colSpan |
Number | Number of columns to span (default: 1) |
rowSpan |
Number | Number of rows to span (default: 1) |
A Grid Cell with colSpan: 2 and rowSpan: 2 placed as the first child would occupy cells 1, 2, 6, and 7:
5x5 Grid with 2x2 Spanning Cell:
Col1 Col2 Col3 Col4 Col5
---- ---- ---- ---- ----
[ SPAN ] 3 4 5 ← Row 1
[ CELL ] 8 9 10 ← Row 2
11 12 13 14 15 ← Row 3
16 17 18 19 20 ← Row 4
21 22 23 24 25 ← Row 5
{
"type": "GridCell",
"props": {
"colSpan": 2,
"rowSpan": 2
},
"children": [
// Your content goes here (containers, charts, widgets, etc.)
]
}For complex layouts, you can nest grids inside each other. Place a Container with layout: "grid" inside a Grid Cell to create a sub-grid.
Outer Grid (3 columns x 3 rows):
[ Header spanning 3 columns ] ← Row 1 (GridCell colSpan: 3)
[ Nav ] [ Main Content Grid ] ← Row 2 (GridCell + nested 2x2 grid)
[ Footer spanning 3 cols ] ← Row 3 (GridCell colSpan: 3)
Main Content Nested Grid (2x2):
[ Chart 1 ] [ Chart 2 ]
[ Chart 3 ] [ Chart 4 ]
colSpan: 3layout: "grid"Grid properties can be made dynamic using JSONata transforms. This allows the grid structure to change based on user input, screen size, data conditions, or other factors.
You can bind the columns and rows properties to form data, context, or calculations:
// Dynamic columns from a form field
{
"columns": {
"__transform": "$components.Form1.data.columns",
"__fallbackValue": 5
}
}
// Dynamic rows based on data count
{
"rows": {
"__transform": "$ceil($count($components.Table1.data) / 5)",
"__fallbackValue": 3
}
}
Grid Cell span properties can also be dynamic:
// Dynamic column span from form
{
"colSpan": {
"__transform": "$components.Form1.data.colSpan",
"__fallbackValue": 2
},
"rowSpan": {
"__transform": "$components.Form1.data.rowSpan",
"__fallbackValue": 2
}
}
A simple grid with 8 KPI tiles arranged in 2 rows:
Grid: 4 columns x 2 rows
[ OEE ] [ Uptime ] [ Output ] [ Quality ] ← Row 1
[ WIP ] [ Backlog ] [ Scrap ] [ Downtime ] ← Row 2
A large main chart with smaller detail widgets:
Grid: 3 columns x 2 rows
[ Main Chart (2x2 span) ] [ Detail 1 ] ← Row 1
[ ] [ Detail 2 ] ← Row 2
GridCell 1: colSpan=2, rowSpan=2 (Main Chart)
Cell 3: Detail widget 1
Cell 6: Detail widget 2
A production floor status display with one tile per workcenter:
Grid: 5 columns x 3 rows
[ WC-01 ] [ WC-02 ] [ WC-03 ] [ WC-04 ] [ WC-05 ] ← Line 1
[ WC-06 ] [ WC-07 ] [ WC-08 ] [ WC-09 ] [ WC-10 ] ← Line 2
[ WC-11 ] [ WC-12 ] [ WC-13 ] [ WC-14 ] [ WC-15 ] ← Line 3
A weekly calendar layout with time slots:
Grid: 7 columns x 5 rows
[ Sun ] [ Mon ] [ Tue ] [ Wed ] [ Thu ] [ Fri ] [ Sat ] ← Day Headers
[ AM ] [ AM ] [ AM ] [ AM ] [ AM ] [ AM ] [ AM ] ← Morning slots
[ Mid ] [ Mid ] [ Mid ] [ Mid ] [ Mid ] [ Mid ] [ Mid ] ← Midday slots
[ PM ] [ PM ] [ PM ] [ PM ] [ PM ] [ PM ] [ PM ] ← Afternoon slots
[ Eve ] [ Eve ] [ Eve ] [ Eve ] [ Eve ] [ Eve ] [ Eve ] ← Evening slots
The Grid Container Demo provides an interactive example you can import and experiment with.
Grid_Container_Demo_0_0_1.json file__fallbackValue for graceful degradation| Issue | Possible Cause | Resolution |
|---|---|---|
| Items stacking vertically instead of grid | Layout not set to "grid" | Verify Container has layout: "grid" |
| Grid only shows one column | Columns property not set or invalid | Set columns to a positive integer (e.g., 5) |
| Grid Cell not spanning | Using Container instead of Grid Cell | Use the Grid Cell component for spanning |
| Items misaligned in cells | justifyItems not configured | Set justifyItems to "center" or "stretch" |
| Dynamic values not working | Transform syntax error or missing context | Verify JSONata syntax and component references |
| Empty cells appearing | Fewer items than grid cells | Add more items or reduce rows/columns |
| Version | Date | Editor | Description |
|---|---|---|---|
| 1.0 | 2025-01-25 | Craig Scott | Initial release with Grid Container Demo v0.0.1 reference and how-to guidance |