C3 AI Documentation Home

Build rich layouts using a grid system

The Grid Layout system organizes and distributes visual components in the UI by defining a grid and column sizes. The system follows a 12-column layout, dividing horizontal space into equal sections for flexible positioning.

Component properties and anatomy

Define one UiSdlGridLayout per page and use this instance as the entry point for the page.

Example layout:

UiSdlGridLayout example

The grid system structure:

UiSdlGridLayout grid

Properties

The properties gridStyle, fixedSize, display, gutter, and pagePadding control spacing and layout behavior. Refer to UiSdlGridLayout for details.

Grid layout main components

A Grid Layout includes four primary components:

  1. Header – A reference to a global page header. See UiSdlGridLayoutHeader.
  2. Nav Menu – A shared navigation menu component.
  3. Detached Fields – Elements outside the Grid Layout system, such as modals or side panels.
  4. Children – The main elements in the Grid Layout, structured using UiSdlGridContainer or UiSdlComponentContainer.

Grid layout system

Columns

A grid consists of 12 columns, allowing components to span multiple columns. Examples:

  • First Row: Three components, each 4 columns wide
  • Second Row: Two components, spanning 8 and 4 columns
  • Third Row: Two components, spanning 4 and 8 columns
Text
+----------------+----------------+----------------+
|                |                |                |
|    4 cols      |     4 cols     |    4 cols      |
|                |                |                |
|                |                |                |
+----------------+----------------+----------------+
|                                 |                |
|              8 cols             |    4 cols      |
|                                 |                |
|                                 |                |
+---------------------------------+----------------+
|                |                                 |
|    4 cols      |              8 cols             |
|                |                                 |
|                |                                 |
+----------------+---------------------------------+

Use UiSdlGridContainer to nest grids within a column:

Text
+----------------+----------------+----------------+
|              8 cols             |                |
| +--------------+--------------+ |    4 cols      |
| |   |                         | |                |
| | 1 |      11   cols          | |                |
| |col|                         | |                |
| |   |                         | |                |
| +---+-------------------------+ |                |
|                                 |                |
+---------------------------------+----------------+

UiSdlGridLayout with nested components

Define gutter and display settings to adjust spacing and orientation.

Containers

The Grid Layout system includes two types of containers:

Example: Mixing ComponentContainer and GridContainer

To create a layout with a header and three horizontally arranged metric tiles:

  1. Define a UiSdlGridContainer spanning 12 columns, setting children to VERTICAL with padding and gutter space.
  2. Add a UiSdlComponentContainer for the full-width header component.
  3. Use a nested UiSdlGridContainer to arrange three metric tiles horizontally.
JSON
"children": [
  {
    "type": "UiSdlGridContainer",
    "column": 12,
    "display": "VERTICAL",
    "padding": 16,
    "gutter": 8,
    "background": "AUTO",
    "children": [
      {
        "type": "UiSdlComponentContainer",
        "isHeader": true,
        "childComponent": "SDLDemo.ReliabilityOverviewHeader"
      },
      {
        "type": "UiSdlGridContainer",
        "display": "HORIZONTAL",
        "gutter": 0,
        "children": [
          {
            "type": "UiSdlComponentContainer",
            "childComponent": "SDLDemo.TilesSparkline1"
          },
          {
            "type": "UiSdlComponentContainer",
            "childComponent": "SDLDemo.TilesSparkline2"
          },
          {
            "type": "UiSdlComponentContainer",
            "childComponent": "SDLDemo.ReliabilityOverviewCollectionList"
          }
        ]
      }
    ]
  }
]

This configuration defines a structured grid layout while maintaining flexibility and readability.

Was this page helpful?