Skip to content

Types Reference

This page documents the TypeScript types used by grafana-react components.

Source: types/panel-base.ts

PropertyTypeRequiredDescription
titlestringYesPanel title
descriptionstringNoPanel description
datasourcestringNoOverride datasource for this panel (defaults to dashboard datasource)
widthnumberNoPanel width in grid units (1-24)
heightnumberNoPanel height in grid units
marginLeftnumberNoLeft margin in grid units - adds empty space before the panel
repeatstringNoVariable to repeat panel for
repeatDirection'v' | 'h'NoRepeat direction
childrenReactNodeNoPanel children (queries or query strings)
extendRecord<string, unknown>NoRaw 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.

Table column override configuration

Source: types/panel-base.ts

PropertyTypeRequiredDescription
namestringYesColumn name to match
unitstringNoDisplay unit
widthnumberNoColumn width in pixels
displayNamestringNoOverride display name for column header
linkTableDataLinkNoData link for cell values
decimalsnumberNoNumber of decimal places
cellMode | 'auto' | 'color-text' | ...NoCell display mode
gaugeMode'basic' | 'gradient' | 'lcd'NoFor gauge cellMode: display mode (basic=solid color, gradient=threshold gradient, lcd=segmented)
minnumberNoFor gauge mode: minimum value
maxnumberNoFor gauge mode: maximum value
thresholdsThresholdSpecNoPer-column thresholds (overrides table-level thresholds)

Transformation configuration

Source: types/panel-base.ts

PropertyTypeRequiredDescription
idstringYesTransformation type ID
optionsRecord<string, unknown>YesTransformation options

Legend configuration

Source: types/display.ts

PropertyTypeRequiredDescription
placementLegendPlacementNo
displayModeLegendDisplayModeNo
calcsLegendCalc[]No
sortBystringNo
sortDescbooleanNo
widthnumberNoWidth of legend in pixels (only applies when placement is ‘right’)

Default field configuration options.

Source: types/defaults.ts

PropertyTypeRequiredDescription
colorModeColorModeNoDefault color mode for panels
axisBorderShowbooleanNoDefault axis border visibility
axisColorMode'text' | 'series'NoDefault axis color mode
axisPlacement'auto' | 'left' | 'right' | 'hidden'NoDefault axis placement
axisGridShowbooleanNoDefault axis grid visibility
lineWidthnumberNoDefault line width
fillnumberNoDefault fill opacity (0-100)
gradientMode'none' | 'opacity' | 'hue' | 'scheme'NoDefault gradient mode
pointSizenumberNoDefault point size
showPoints'auto' | 'always' | 'never'NoDefault show points mode
thresholdStyleThresholdStyleNoDefault threshold display style
seriesByColorSeriesByNoFor continuous color modes, default value to use for color calculation

Default panel options.

Source: types/defaults.ts

PropertyTypeRequiredDescription
legendLegendConfig | falseNoDefault legend configuration
tooltipMode'single' | 'multi' | 'none'NoDefault tooltip mode
tooltipSort'none' | 'asc' | 'desc'NoDefault tooltip sort order

Combined defaults for panels.

Source: types/defaults.ts

Extends FieldDefaults

Scale distribution configuration

Source: types/common/axis.ts

PropertyTypeRequiredDescription
typeScaleDistributionTypeYesScale type
lognumberNoLog base when type is ‘log’ (default: 2)
linearThresholdnumberNoLinear threshold for symlog scale

Axis configuration

Source: types/common/axis.ts

PropertyTypeRequiredDescription
axisPlacementAxisPlacementNoAxis placement relative to the graph
axisLabelstringNoAxis label text
axisWidthnumberNoAxis width in pixels
axisSoftMinnumberNoSoft minimum (can be exceeded by data)
axisSoftMaxnumberNoSoft maximum (can be exceeded by data)
axisColorModeAxisColorModeNoAxis color mode
axisGridShowbooleanNoShow axis grid lines
axisBorderShowbooleanNoShow axis border
axisCenteredZerobooleanNoCenter axis at zero
scaleDistributionScaleDistributionConfigNoScale distribution configuration

Tooltip configuration

Source: types/common/viz-options.ts

PropertyTypeRequiredDescription
modeTooltipDisplayModeYesTooltip display mode
sortSortOrderNoSort order for values in tooltip (defaults to ‘none’)
maxHeightnumberNoMaximum tooltip height in pixels
maxWidthnumberNoMaximum tooltip width in pixels

Data reduction options

Source: types/common/viz-options.ts

PropertyTypeRequiredDescription
calcs(LegendCalc | string)[]YesCalculations to perform (e.g., ‘mean’, ‘max’, ‘last’)
fieldsstringNoField name or regex to match
valuesbooleanNoReduce all values, not just series
limitnumberNoLimit number of values

Hide series configuration

Source: types/common/viz-options.ts

PropertyTypeRequiredDescription
legendbooleanYesHide from legend
tooltipbooleanYesHide from tooltip
vizbooleanYesHide from visualization

Single stat base options

Source: types/common/viz-options.ts

Extends TextFormattingOptions

PropertyTypeRequiredDescription
reduceOptionsReduceDataOptionsNoData reduction options
orientationVizOrientationNoOrientation of the visualization

Stacking configuration

Source: types/common/field-config.ts

PropertyTypeRequiredDescription
modeStackingModeYesStacking mode
groupstringNoStack group identifier

Line style configuration

Source: types/common/field-config.ts

PropertyTypeRequiredDescription
fillLineStyleFillNoLine fill style
dashnumber[]NoDash pattern array [dash, gap, dash, gap, …]

Graph thresholds style configuration

Source: types/common/field-config.ts

PropertyTypeRequiredDescription
modeThresholdStyleYesThreshold display mode

Graph field configuration

Source: types/common/field-config.ts

Extends AxisConfig

PropertyTypeRequiredDescription
drawStyle'line' | 'bars' | 'points'NoDraw style for the series
gradientModeGraphGradientModeNoGradient mode for fill
thresholdsStyleGraphThresholdsStyleConfigNoThreshold display style
lineColorstringNoLine color override
lineWidthnumberNoLine width in pixels
lineInterpolationLineInterpolationNoLine interpolation style
lineStyleLineStyleConfigNoLine style (solid, dash, dot)
fillColorstringNoFill color override
fillOpacitynumberNoFill opacity (0-100)
showPointsVisibilityModeNoShow points on lines
pointSizenumberNoPoint size in pixels
pointColorstringNoPoint color override
stackingStackingConfigNoStacking configuration
hideFromHideSeriesConfigNoHide series from legend/tooltip/viz
barAlignmentBarAlignmentNoBar alignment relative to time point
barMaxWidthnumberNoMaximum bar width in pixels
barWidthFactornumberNoBar width factor (0-1)
spanNullsboolean | numberNoConnect null values (true, false, or threshold in ms)
insertNullsboolean | numberNoInsert nulls when time gap exceeds threshold (true, false, or threshold in ms)
transform'constant' | 'negative-Y'NoTransform values