Skip to content

Board Imports

Build modular dashboards by importing other board files or referencing specific sections of other boards.


Importing Files

Include the entire content of another board file by referencing its filename (without extension). This is useful for splitting large dashboards into smaller, manageable files.

# File: main_dashboard.yml
title: "Company Overview"
rows:
  - _header_section       # Imports content from _header_section.yml
  - _sales_kpis           # Imports content from _sales_kpis.yml
  - _marketing_kpis       # Imports content from _marketing_kpis.yml

Partial Files

Files starting with _ are commonly used for components that aren't meant to be viewed alone:

dashboards/
├── main_dashboard.yml      # Main entry point
├── _header_section.yml     # Partial: header
├── _sales_kpis.yml         # Partial: sales KPIs
├── _marketing_kpis.yml     # Partial: marketing KPIs
└── _footer.yml             # Partial: footer

Named Section References

Reference specific parts of another board file by giving nested boards an explicit id.

Step 1: Define a Named Board

Add an id to any layout section you want to reuse:

# File: sales_dashboard.yml
rows:
  - id: kpi_section  # Give this section an ID
    title: "Key Performance Indicators"
    cols:
      - revenue_kpi
      - orders_kpi

  - id: trends_section
    title: "Trends"
    rows:
      - revenue_trend
      - orders_trend

Step 2: Reference the Named Board

Reference that section from any other file using filename.id:

# File: executive_summary.yml
rows:
  - sales_dashboard.kpi_section      # Only the KPI section
  - marketing_dashboard.kpi_section  # From another file

Use Cases

Shared Headers/Footers

# _header.yml
content: |
  # Company Dashboard
  Last updated: <function define_env.<locals>.now at 0x7fa8737522a0>
style:
  background: "#1e40af"
  color: white
# any_dashboard.yml
rows:
  - _header
  - main_content
  - _footer

Reusable KPI Rows

# _standard_kpis.yml
cols:
  - revenue_kpi
  - orders_kpi
  - growth_kpi
# sales.yml
rows:
  - _standard_kpis
  - sales_specific_content

# marketing.yml
rows:
  - _standard_kpis
  - marketing_specific_content

Component Library

# components/_metric_card.yml
id: metric_card
style:
  background: "#f3f4f6"
  padding: "1rem"
cols:
  - content: "{{ title }}"
  - content: "{{ value }}"

Best Practices

File Organization

dashboards/
├── main.yml                # Entry points
├── sales.yml
├── marketing.yml
├── _components/            # Shared components
│   ├── _header.yml
│   ├── _footer.yml
│   └── _kpi_row.yml
└── _queries/               # Shared queries
    └── _common_queries.yml

Naming Conventions

  • Use _ prefix for partials (non-standalone files)
  • Use descriptive names: _sales_kpis.yml not _kpis.yml
  • Group related partials in folders

When to Extract

Extract to a partial when: - Content is used in 2+ places - Section is large and complex - You want to test a section in isolation