Skip to content

Widgets

Widgets are the visual building blocks of a dashboard. Each widget occupies a number of columns in a 12-column grid.

Common Fields

FieldTypeRequiredDescription
namestringYesDisplay name
typestringYesmetric, chart, table, text, image, or divider
colintegerNoColumn span from 1 to 12
descriptionstringNoOptional tooltip or subtitle

Data-backed widgets (metric, chart, table) also need a query source: query (named query reference), sql (inline), file (external .sql path), or a semantic reference (metric: for metric widgets, dimension: + metrics: for charts). See Queries & Templating for the full reference, including the connection override.

Metric

Metric widgets display a single value.

yaml
- name: Total Revenue
  type: metric
  sql: SELECT SUM(amount) AS value FROM sales
  column: value
  prefix: "$"
  format: number
  col: 3

Metric widgets can also use semantic models:

yaml
- name: Total Revenue
  type: metric
  model: sales
  metric: revenue
  filters:
    - dimension: created_at
      operator: between
      value:
        start: "{{ filters.date_range.start }}"
        end: "{{ filters.date_range.end }}"
  prefix: "$"
  format: number
  col: 3

Semantic metric widgets inherit the dashboard-level model when model is omitted. See Semantic Layer for model files, filters, segments, and aliases.

Metric-specific fields:

FieldTypeDescription
columnstringResult column to display for SQL-backed metrics
metricstringSemantic metric name
prefixstringText before the value
suffixstringText after the value
formatstringnumber, currency, or percent

Chart

Charts visualize one or more series. The chart field selects the chart type and determines which fields are required.

Chart types

ChartRequiredOptionalDescription
linex, yLine chart
barx, ystackedBar chart
areax, ystackedArea chart
pielabel, valuePie/donut chart
scatterx, yScatter plot
bubblex, y, sizeBubble chart
combox, ylinesMixed bar + line chart (y series in lines render as lines, the rest as bars)
histogramxbinsHistogram (client-side binning)
boxplotx, yBox-and-whisker plot (client-side quartiles)
funnellabel, valueFunnel chart
sankeysource, target, valueSankey/flow diagram
heatmapx, y, valueGrid heatmap
calendarx, valueGitHub-style calendar heatmap
sparklinex, yCompact inline line (60px), no axes
waterfallx, yWaterfall chart
xmrx, yyMin, yMaxControl chart with limits
dumbbellx, y (2 columns)Horizontal range comparison
gaugevaluetargetSemi-circular KPI-vs-target gauge (uses first row)
treemaplabel, valueRectangular part-to-whole hierarchy
radarx, yMulti-axis polar comparison
candlestickx, open, high, low, closeOHLC chart

SQL-backed example:

yaml
- name: Revenue Trend
  type: chart
  chart: area
  sql: |
    SELECT month, revenue
    FROM monthly_revenue
    ORDER BY month
  x: month
  y: [revenue]
  col: 8

Semantic example:

yaml
- name: Revenue Trend
  type: chart
  chart: area
  model: sales
  dimension: created_at
  granularity: month
  metrics: [revenue]
  sort:
    - name: created_at
      direction: asc
  col: 8

Common chart fields:

FieldTypeDescription
chartstringChart type
xstringX-axis column for SQL-backed charts
ystring[]Y-axis columns for SQL-backed charts
labelstringLabel column for pie, funnel, and treemap charts
valuestringValue column for pie, funnel, heatmap, calendar, treemap, and gauge charts
sourcestringSource node column for sankey charts
targetstringTarget/max column for gauge charts (also sankey target node)
openstringOpen column for candlestick charts
highstringHigh column for candlestick charts
lowstringLow column for candlestick charts
closestringClose column for candlestick charts
stackedbooleanStack series for bar and area charts
sizestringBubble size column for bubble charts
linesstring[]Which y series render as lines (rest as bars) for combo charts
binsintegerNumber of bins for histogram charts (default 10)
yMinstringLower control limit column for xmr charts
yMaxstringUpper control limit column for xmr charts
dimensionstringSemantic dimension name
granularitystringSemantic time grain for dimension
metricsstring[]Semantic metric names
filtersarraySemantic filters
segmentsstring[]Semantic segments
sortarraySort instructions
limitintegerRow limit

Charts using dimension, metrics, segments, or semantic filters are compiled through the backend semantic layer instead of requiring hand-written SQL.

Table

Tables display query results in a scrollable grid.

SQL-backed example:

yaml
- name: Recent Orders
  type: table
  sql: |
    SELECT id, customer_name, amount, status, created_at
    FROM orders
    ORDER BY created_at DESC
    LIMIT 20
  columns:
    - name: id
      label: Order ID
    - name: amount
      label: Amount
      format: currency

Semantic example:

yaml
- name: Sales Breakdown
  type: table
  model: sales
  dimensions:
    - name: region
    - name: channel
  metrics: [revenue, sales_count]
  sort:
    - name: revenue
      direction: desc
  columns:
    - name: region
      label: Region
    - name: revenue
      label: Revenue
      format: currency

Tables can mix semantic dimensions and metrics with explicit columns metadata for display labels and formatting.

Table column fields:

FieldTypeDescription
namestringResult column name (must match the SQL output)
labelstringDisplay header (defaults to name)
formatstringnumber or currency

Text

Text widgets render Markdown content.

yaml
- name: Notes
  type: text
  col: 6
  content: |
    **Important:** Data refreshes daily at 06:00 UTC.

Supported markdown:

  • Headers (# through ######)
  • Bold (**text**), italic (*text*), bold italic (***text***), strikethrough (~~text~~)
  • Inline code (`code`)
  • Links ([text](url)) and images (![alt](src))
  • Unordered lists (- or *) and ordered lists (1.)
  • Blockquotes (> text)
  • Horizontal rules (---, ***, or ___)

Image

Image widgets render an image from a URL.

yaml
- name: Logo
  type: image
  col: 3
  src: https://example.com/logo.png
  alt: Company Logo

Image-specific fields:

FieldTypeRequiredDescription
srcstringYesImage URL
altstringNoAlt text for accessibility

Divider

Divider widgets add visual separation between sections.

yaml
- name: Section Break
  type: divider
  col: 12