Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

Using CSS Grid layouts to build a page

Create a CSS Grid layout in UI Builder to build powerful pages so that you can customize with cascading style sheets (CSS) and can improve your performance.

CSS Grid is the most powerful layout system in CSS. CSS Grid is built on top of a two-dimensional grid. CSS Grid gives you control over how you create your pages. Use UI Builder to implement a CSS Grid layout using low-code layout configuration properties. For advanced layouts, you can view and edit CSS code to customize your layouts. Visit Mozilla to learn more about CSS Grid.

For example, you can have a grid with three columns and three rows to make a grid nine cells. You can place components inside these cells or make the component span multiple cells.

Image omitted: UIB-layout-css-grid.png
CSS Grid layout

Customizing the layout of your page lets you take full advantage of CSS Grid so that you can achieve your overall page design. For more information, see Organize components in UI Builder pages.

To find out more about CSS layouts within your UI Builder instance, you can find them in the [sys_uib_template] table.

Parent Topic:Organize components in UI Builder pages

Create a CSS Grid layout with the new layout system

Create a CSS Grid layout in UI Builder to build powerful pages in a low-code environment.

Before you begin

Role required: admin

Procedure

  1. Navigate to All > Now Experience Framework > UI Builder.

  2. Open an experience to work in or create an experience by selecting Create > Experience.

    See Configure how users interact with your applications in UI Builder for more information on creating experiences.

  3. Create a page in UI Builder.

  4. Select the + Add content button in the UI Builder stage.

  5. Select Grid in the layouts tab.

Image omitted: grid-select-toolbox.png
Arrow pointing to the Grid option in the layouts tab of the toolbox.
  1. Select the Styles tab in the configuration panel.

  2. In the Layout section, you should see Grid highlighted.

Image omitted: grid-highlighted.png
Arrow pointing to the Grid option in the configuration panel styles tab.
  1. In the Layout section of the styles tab, you can change the following:

    • Columns

      Defines the number, order, and width of grid columns.

    • Rows

      Defines the number, order, and width of grid rows.

    • Direction

      Sets whether newly added components are stacked horizontally or vertically.

    • Gap

      Sets the size of the gap between rows and columns.

      Note: Select Show advanced layout options to see the next four options.

    • Align items

      Defines how components within the container align as a group.

    • Justify items

      Defines how the browser distributes space between and around content items along the inline axis of a grid container.

    • Align content

      Sets the distribution of space between and around content items along a grid's block axis.

    • Justify content

      Defines how to pack or space apart the components within the container.

    Visit Mozilla to learn more about CSS Grid layout configurations.

  2. You can edit the CSS code by selecting Show advanced configuration options at the bottom of the Styles tab, and then selecting the View and edit CSS option.

  3. Select Save.

    Your page refreshes and displays the changes made to the layout.

  4. Add components to your page.

    See Add and configure components for more information.

  5. View and test your page by selecting

Image omitted: preview-button.png
Preview button that opens the page variant..

Create a CSS Grid layout with the old layout system

Create a CSS Grid layout in UI Builder to build powerful pages so that you can customize with cascading style sheets (CSS) and can improve your performance.

Before you begin

Role required: admin

About this task

In the following procedure, you learn how to use CSS Grid to modify your CSS to customize the layout of your page.

Procedure

  1. Navigate to All > Now Experience Framework > UI Builder.

  2. Open an experience to work in or create an experience by selecting Create > Experience.

    See Configure how users interact with your applications in UI Builder for more information on creating experiences.

  3. Create a page in UI Builder or open a page.

  4. Click the Layout tab and choose the two-row by two-column layout.

Image omitted: UIB-layouts-custom-four-standard.png
Standard two row, two-column layout.
  1. Click Edit layout code.
Image omitted: UIB-layouts-context-menu.png
Edit layout code option.
  1. Expand the code editor so that you can easily view the CSS code.
Image omitted: UIB-layouts-expand-edit-layout.png
Arrow pointing to the expand the code editor button.
  1. Add another slot to the layout by copying the CSS code for an existing slot.

    Copying the CSS code is easier than typing it into the layout.

Image omitted: UIB-layouts-copy-css-block.png
Arrow pointing to copying the CSS code for a slot.
  1. Paste the CSS code below the code that you copied and change the slotName and grid-area to a unique value.
Image omitted: UIB-layouts-paste-css-block.png
Pasting the CSS code.
  1. Modify the layout rules to include the new column and template area, as follows:

    1. Delete the "Grid-template-columns": "1fr 1fr", line.

    2. Add a second cell1 after cell1, and then add cell5 after cell4.

Image omitted: UIB-layouts-modifyCSS.png
Modifying the layout rules.
You can set many different configurations. In this example, there are the two resulting grids from two different grid template areas. The **"grid-template-areas"** property being modified is setting the CSS property of the same name. For more information, see [MDN grid-templates-areas](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-areas).
Image omitted: UIB-layouts-grid-template-areas.png
Grid template areas.
  1. Collapse the expanded view, and then click Apply.
Image omitted: UIB-layouts-click-apply.png
Applying a layout change.

Result

The new CSS Grid layout shows that the new slot was added to the original two-row, two-column layout.

Image omitted: UIB-layouts-custom-finalview.png
New custom layout.

Click Reset to original to reset the layout changes back to the original at any time.

Image omitted: UIB-layouts-reset-to-original.png
Arrow pointing to reset to original option.

Related topics

Create a Flexbox layout with the old layout system