Skip to content

Nested Layouts Example

A board demonstrating complex layouts using nested sections.


Complete Board

title: "Dashboard with Nested Layouts"

source: db

queries:
  totals:
    sql: |
      SELECT SUM(revenue) AS total_revenue, SUM(documents_created) AS documents
      FROM dundersign_serving.monthly_metrics

  monthly:
    sql: |
      SELECT month, revenue, active_users, documents_created
      FROM dundersign_serving.monthly_metrics
      WHERE month > (SELECT MIN(month) FROM dundersign_serving.monthly_metrics)
        AND month < (SELECT MAX(month) FROM dundersign_serving.monthly_metrics)
      ORDER BY month

rows:
  # Level 1: Main Container
  - cols:
      # Left sidebar (auto width if not specified)
      - width: "25%"
        rows:
          - title: "KPIs"
            charts:
              revenue_kpi:
                label: "Revenue"
                query: queries.totals
                type: kpi
                value: total_revenue
              documents_kpi:
                label: "Documents"
                query: queries.totals
                type: kpi
                value: documents

            # Sidebar content - stacked KPIs
            rows:
              - revenue_kpi
              - documents_kpi

      # Main content (75% width)
      - width: "75%"
        rows:
          - title: "Trends"
            # Top charts row
            cols:
              - revenue_trend:
                  title: "Revenue"
                  query: queries.monthly
                  type: line
                  x: month
                  y: revenue
              - users_trend:
                  title: "Active Users"
                  query: queries.monthly
                  type: line
                  x: month
                  y: active_users

          # Bottom chart (full width)
          - details_table:
              title: "Monthly Details"
              query: queries.monthly
              type: table
Dashboard with Nested Layouts KPIs 23k Revenue 55k Documents Trends Oct2025Jan2026AprJul01,0002,000RevenueOct2025Jan2026AprJul05001,000Active Users Monthly DetailsMonthRevenueActive UsersDocuments Created1 Sep 2025151215111 Oct 20257414261.68K1 Nov 20251.71K7893K1 Dec 20252.35K1.03K6.98K1 Jan 20261.5K9924.37K1 Feb 20262.16K8133.91K1 Mar 20262.62K7856.38K1 Apr 20262.53K7475.18K1 May 20262.7K7916.04K1 Jun 20262.33K7927.15K1 Jul 20262.6K8106.47K Data as of 14:52 UTC on 21 Aug 2026 made with dbt charts

Layout Explanation

Visual Structure

┌─────────────┬──────────────────────────────────┐
│   KPIs      │         Trends                   │
│             │                                  │
│ Revenue KPI │ ┌────────────┬────────────┐      │
│             │ │ Revenue    │ Active     │      │
│ Docs KPI    │ │ Trend      │ Users      │      │
│             │ └────────────┴────────────┘      │
│             │                                  │
│             │ ┌─────────────────────────┐      │
│             │ │ Monthly Details Table   │      │
│             │ └─────────────────────────┘      │
└─────────────┴──────────────────────────────────┘

Nesting Levels

  1. Root Board: Has a rows layout (default).
  2. Row 1: Has a cols layout to split Sidebar (25%) vs Main (75%).
  3. Sidebar: Has a rows layout to stack KPIs vertically.
  4. Main: Has a rows layout to stack Trends on top of Details.
  5. Trends: Has a cols layout to put the Revenue and Active Users charts side-by-side.

Key Concepts

Alternating Row/Column Splits

The pattern for nested layouts: - Rows: Stack vertical - Cols: Stack horizontal - Grid: 2D arrangement

This creates flexible, responsive layouts.

Board Nesting

Any item in a layout list can be another full board definition:

rows:
  - cols:  # Nested board
      - item_1
      - item_2

Layout Types in Nested Sections

Each nested board can have its own layout: - rows: Vertical arrangement - cols: Horizontal arrangement - grid: Grid layout - tabs: Tabbed organization


When to Use Nested Layouts

Sidebar + Main Content

Use cols for the main split:

cols:
  - width: "250px"
    rows: [...] # Sidebar content
  - rows: [...] # Main content

Multi-Column Layouts

Create multi-column boards:

cols:
  - rows: [...] # Column 1
  - rows: [...] # Column 2
  - rows: [...] # Column 3

Complex Grids

Combine nested sections with grid layouts:

rows:
  - grid:
      columns: 24
      items:
        - item: chart1
          width: 12
        - item: chart2
          width: 12

Best Practices

Limit Nesting Depth

Avoid too many nesting levels (3-4 max): - Harder to understand - More complex to maintain - Can impact performance

Use Descriptive Titles

Add titles to nested sections for clarity:

rows:
  - title: "KPIs"
    cols: [...]

Test Responsive Behavior

Nested layouts adapt to screen size: - cols layouts wrap to vertical stacks on mobile - grid layouts reflow based on available width