Types Reference
This page documents the TypeScript types used by grafana-react components.
Quick Reference
Section titled “Quick Reference”- BasePanelProps - Type definition
- TableColumnOverride - Table column override configuration
- Transformation - Transformation configuration
- LegendConfig - Legend configuration
- FieldDefaults - Default field configuration options.
- PanelOptionDefaults - Default panel options.
- PanelDefaults - Combined defaults for panels.
- ScaleDistributionConfig - Scale distribution configuration
- AxisConfig - Axis configuration
- VizTooltipOptions - Tooltip configuration
- ReduceDataOptions - Data reduction options
- HideSeriesConfig - Hide series configuration
- SingleStatBaseOptions - Single stat base options
- StackingConfig - Stacking configuration
- LineStyleConfig - Line style configuration
- GraphThresholdsStyleConfig - Graph thresholds style configuration
- GraphFieldConfig - Graph field configuration
BasePanelProps
Section titled “BasePanelProps”Source: types/panel-base.ts
| Property | Type | Required | Description |
|---|---|---|---|
title | string | Yes | Panel title |
description | string | No | Panel description |
datasource | string | No | Override datasource for this panel (defaults to dashboard datasource) |
width | number | No | Panel width in grid units (1-24) |
height | number | No | Panel height in grid units |
marginLeft | number | No | Left margin in grid units - adds empty space before the panel |
repeat | string | No | Variable to repeat panel for |
repeatDirection | 'v' | 'h' | No | Repeat direction |
children | ReactNode | No | Panel children (queries or query strings) |
extend | Record<string, unknown> | No | Raw JSON to deep-merge into the panel output. |
| Use this escape hatch for Grafana features not yet supported by typed props, | |||
| or for custom Grafana fork extensions. |
TableColumnOverride
Section titled “TableColumnOverride”Table column override configuration
Source: types/panel-base.ts
| Property | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Column name to match |
unit | string | No | Display unit |
width | number | No | Column width in pixels |
displayName | string | No | Override display name for column header |
link | TableDataLink | No | Data link for cell values |
decimals | number | No | Number of decimal places |
cellMode | | 'auto' | 'color-text' | ... | No | Cell display mode |
gaugeMode | 'basic' | 'gradient' | 'lcd' | No | For gauge cellMode: display mode (basic=solid color, gradient=threshold gradient, lcd=segmented) |
min | number | No | For gauge mode: minimum value |
max | number | No | For gauge mode: maximum value |
thresholds | ThresholdSpec | No | Per-column thresholds (overrides table-level thresholds) |
Transformation
Section titled “Transformation”Transformation configuration
Source: types/panel-base.ts
| Property | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Transformation type ID |
options | Record<string, unknown> | Yes | Transformation options |
LegendConfig
Section titled “LegendConfig”Legend configuration
Source: types/display.ts
| Property | Type | Required | Description |
|---|---|---|---|
placement | LegendPlacement | No | |
displayMode | LegendDisplayMode | No | |
calcs | LegendCalc[] | No | |
sortBy | string | No | |
sortDesc | boolean | No | |
width | number | No | Width of legend in pixels (only applies when placement is ‘right’) |
FieldDefaults
Section titled “FieldDefaults”Default field configuration options.
Source: types/defaults.ts
| Property | Type | Required | Description |
|---|---|---|---|
colorMode | ColorMode | No | Default color mode for panels |
axisBorderShow | boolean | No | Default axis border visibility |
axisColorMode | 'text' | 'series' | No | Default axis color mode |
axisPlacement | 'auto' | 'left' | 'right' | 'hidden' | No | Default axis placement |
axisGridShow | boolean | No | Default axis grid visibility |
lineWidth | number | No | Default line width |
fill | number | No | Default fill opacity (0-100) |
gradientMode | 'none' | 'opacity' | 'hue' | 'scheme' | No | Default gradient mode |
pointSize | number | No | Default point size |
showPoints | 'auto' | 'always' | 'never' | No | Default show points mode |
thresholdStyle | ThresholdStyle | No | Default threshold display style |
seriesBy | ColorSeriesBy | No | For continuous color modes, default value to use for color calculation |
PanelOptionDefaults
Section titled “PanelOptionDefaults”Default panel options.
Source: types/defaults.ts
| Property | Type | Required | Description |
|---|---|---|---|
legend | LegendConfig | false | No | Default legend configuration |
tooltipMode | 'single' | 'multi' | 'none' | No | Default tooltip mode |
tooltipSort | 'none' | 'asc' | 'desc' | No | Default tooltip sort order |
PanelDefaults
Section titled “PanelDefaults”Combined defaults for panels.
Source: types/defaults.ts
Extends FieldDefaults
ScaleDistributionConfig
Section titled “ScaleDistributionConfig”Scale distribution configuration
Source: types/common/axis.ts
| Property | Type | Required | Description |
|---|---|---|---|
type | ScaleDistributionType | Yes | Scale type |
log | number | No | Log base when type is ‘log’ (default: 2) |
linearThreshold | number | No | Linear threshold for symlog scale |
AxisConfig
Section titled “AxisConfig”Axis configuration
Source: types/common/axis.ts
| Property | Type | Required | Description |
|---|---|---|---|
axisPlacement | AxisPlacement | No | Axis placement relative to the graph |
axisLabel | string | No | Axis label text |
axisWidth | number | No | Axis width in pixels |
axisSoftMin | number | No | Soft minimum (can be exceeded by data) |
axisSoftMax | number | No | Soft maximum (can be exceeded by data) |
axisColorMode | AxisColorMode | No | Axis color mode |
axisGridShow | boolean | No | Show axis grid lines |
axisBorderShow | boolean | No | Show axis border |
axisCenteredZero | boolean | No | Center axis at zero |
scaleDistribution | ScaleDistributionConfig | No | Scale distribution configuration |
VizTooltipOptions
Section titled “VizTooltipOptions”Tooltip configuration
Source: types/common/viz-options.ts
| Property | Type | Required | Description |
|---|---|---|---|
mode | TooltipDisplayMode | Yes | Tooltip display mode |
sort | SortOrder | No | Sort order for values in tooltip (defaults to ‘none’) |
maxHeight | number | No | Maximum tooltip height in pixels |
maxWidth | number | No | Maximum tooltip width in pixels |
ReduceDataOptions
Section titled “ReduceDataOptions”Data reduction options
Source: types/common/viz-options.ts
| Property | Type | Required | Description |
|---|---|---|---|
calcs | (LegendCalc | string)[] | Yes | Calculations to perform (e.g., ‘mean’, ‘max’, ‘last’) |
fields | string | No | Field name or regex to match |
values | boolean | No | Reduce all values, not just series |
limit | number | No | Limit number of values |
HideSeriesConfig
Section titled “HideSeriesConfig”Hide series configuration
Source: types/common/viz-options.ts
| Property | Type | Required | Description |
|---|---|---|---|
legend | boolean | Yes | Hide from legend |
tooltip | boolean | Yes | Hide from tooltip |
viz | boolean | Yes | Hide from visualization |
SingleStatBaseOptions
Section titled “SingleStatBaseOptions”Single stat base options
Source: types/common/viz-options.ts
Extends TextFormattingOptions
| Property | Type | Required | Description |
|---|---|---|---|
reduceOptions | ReduceDataOptions | No | Data reduction options |
orientation | VizOrientation | No | Orientation of the visualization |
StackingConfig
Section titled “StackingConfig”Stacking configuration
Source: types/common/field-config.ts
| Property | Type | Required | Description |
|---|---|---|---|
mode | StackingMode | Yes | Stacking mode |
group | string | No | Stack group identifier |
LineStyleConfig
Section titled “LineStyleConfig”Line style configuration
Source: types/common/field-config.ts
| Property | Type | Required | Description |
|---|---|---|---|
fill | LineStyleFill | No | Line fill style |
dash | number[] | No | Dash pattern array [dash, gap, dash, gap, …] |
GraphThresholdsStyleConfig
Section titled “GraphThresholdsStyleConfig”Graph thresholds style configuration
Source: types/common/field-config.ts
| Property | Type | Required | Description |
|---|---|---|---|
mode | ThresholdStyle | Yes | Threshold display mode |
GraphFieldConfig
Section titled “GraphFieldConfig”Graph field configuration
Source: types/common/field-config.ts
Extends AxisConfig
| Property | Type | Required | Description |
|---|---|---|---|
drawStyle | 'line' | 'bars' | 'points' | No | Draw style for the series |
gradientMode | GraphGradientMode | No | Gradient mode for fill |
thresholdsStyle | GraphThresholdsStyleConfig | No | Threshold display style |
lineColor | string | No | Line color override |
lineWidth | number | No | Line width in pixels |
lineInterpolation | LineInterpolation | No | Line interpolation style |
lineStyle | LineStyleConfig | No | Line style (solid, dash, dot) |
fillColor | string | No | Fill color override |
fillOpacity | number | No | Fill opacity (0-100) |
showPoints | VisibilityMode | No | Show points on lines |
pointSize | number | No | Point size in pixels |
pointColor | string | No | Point color override |
stacking | StackingConfig | No | Stacking configuration |
hideFrom | HideSeriesConfig | No | Hide series from legend/tooltip/viz |
barAlignment | BarAlignment | No | Bar alignment relative to time point |
barMaxWidth | number | No | Maximum bar width in pixels |
barWidthFactor | number | No | Bar width factor (0-1) |
spanNulls | boolean | number | No | Connect null values (true, false, or threshold in ms) |
insertNulls | boolean | number | No | Insert nulls when time gap exceeds threshold (true, false, or threshold in ms) |
transform | 'constant' | 'negative-Y' | No | Transform values |