Skip to main content

Widget SDK Reference

API reference for @radarboard/widget-sdk — template config, recipes, section helpers, and testing.

./types

DataSourceFormat

How a data value should be formatted when rendered.
  • "currency" — locale-aware currency (e.g. $1,234.56)
  • "number" — locale-aware number (e.g. 1,234)
  • "percent" — percentage with % suffix
  • "date" — date string
  • "relative-time" — “2 hours ago” style
  • "duration-seconds" — seconds → human-readable duration

DataSource

A pointer to a field in a resolved data source. This is the fundamental building block of the template system. Every section config uses DataSource to bind UI elements to data from your integration. Example:

DataSourceDeclaration

Declares a data source ID that this widget template depends on. Listed in WidgetTemplateConfig.dataSources to register which resolvers need to run before the template can render.

LayoutGap

Gap size between sections in a layout.

AlertCondition

AlertSectionConfig

Alert/banner section — displays a warning, error, or info message.

KPIMetricConfig

KPIRowSectionConfig

A horizontal row of KPI metric cards. Example:

SummaryQuadMetricSlotConfig

SummaryQuadSparklineSlotConfig

SummaryQuadEmptySlotConfig

SummaryQuadSlotConfig

SummaryQuadSectionConfig

A 2x2 grid of metric slots (metric, sparkline, or empty).

HeadlineStatSectionConfig

A large featured number with a label — great for hero metrics.

OverviewPanelRowConfig

OverviewPanelSectionConfig

Overview panel with eyebrow, title, metric, badge, description, and detail rows.

ListItemTemplate

TemplateSelectionDialogConfig

TemplateSelectionConfig

InlineListHeaderColumnConfig

InlineListHeaderConfig

ListSectionConfig

A scrollable list of items with title, subtitle, badge, and optional selection. Example:

RowListBadgeConfig

RowListStatusConfig

RowListItemTemplate

RowListSectionConfig

Compact row list with status dots/icons, badges, and timestamps.

StreamListSectionConfig

Real-time event stream with log levels, search, and auto-scroll.

FilterBarSelectControlConfig

FilterBarRangeControlConfig

FilterBarToggleControlConfig

FilterBarControlConfig

FilterBarSectionConfig

Filter bar with select, range, and toggle controls.

DenseRankedTableFilterRule

DenseRankedTableColumnConfig

DenseRankedTableSectionConfig

Dense ranked table with sorting, filtering, and compact/expanded variants.

TableColumnConfig

TableSectionConfig

A data table with sortable columns and optional search.

CardListMetaConfig

CardListSectionConfig

A grid of cards with title, image, badge, and optional search.

ChartSeriesConfig

ChartSectionConfig

A chart section — area, line, bar, or sparkline. Example:

ActivityChartSegmentConfig

ActivityChartSectionConfig

GitHub-style contribution heatmap with colored segments.

TabConfig

TabsSectionConfig

Tabbed content — switches between different section sets.

StackLayoutConfig

Vertical stack layout — sections arranged top to bottom.

GridLayoutConfig

Grid layout — sections arranged in columns.

SplitLayoutConfig

Split layout — left rail + right content area.

SectionConfig

Union of all possible section types in a widget template. Sections are the building blocks of widget layouts. Combine them in WidgetTemplateConfig.sections or use recipe helpers like createSummaryListRecipe() to compose common patterns.

WidgetTemplateConfig

Top-level configuration for a template-driven widget. This is the primary config type that widget authors define. It declares which data sources to resolve and which sections to render in the compact and expanded views. Example:

CreateTemplateDescriptorOptions

./widget-types

WidgetModalSize

Size of the expanded widget overlay: “sm”, “md”, or “lg”.

GridSlot

The 9 content grid slots (3x3). Chrome widgets (TopBar, Tabs, KPIs, Ticker) are not slotted.

WidgetRenderProps

Props every widget module component receives.

WidgetOAuthConfig

OAuth-specific config for providers that need the redirect flow.

WidgetAuth

How a widget authenticates with its external API.

WidgetAuthField

A single credential input field in the widget card’s Connection section.

WidgetDisplayContext

Context passed to dynamic widget functions like getDisplayName and getSourceIds.

WidgetPollingConfig

WidgetTemplateVisualEditorBinding

WidgetVisualEditorBinding

WidgetVariant

A named layout variant preset defined by the widget author.

CustomVariant

A user-created variant stored in the per-instance widget config.

WidgetExpandAction

Controls what happens when the user clicks the expand button on a widget.

WidgetDescriptor

Describes a widget template in the registry. Extends: ExtensionMeta

Capability Governance

Use capabilities to describe widget ownership of shared Radarboard surfaces:
  • role: "canonical" means the widget is the primary surface for that capability.
  • role: "specialized" means the widget intentionally overlaps an existing capability without owning it.
  • providers must point at real integration/action pairs.
  • requiredIntegrations does not replace capabilities; it only controls relevance and availability filtering.
Canonical widgets can use capability metadata to resolve a provider at runtime. The Revenue and Observability widgets are the reference implementations.

./recipes

stackLayout()

Create a vertical stack layout from sections.

gridLayout()

Create a multi-column grid layout from sections.

splitLayout()

Create a split layout with a left rail and right content area.

createSummaryContentRecipe()

Recipe: KPI summary strip + rich content area below.

createSummaryOnlyRecipe()

Recipe: KPI metrics only — no content below. Good for status displays.

createContentOnlyRecipe()

Recipe: Content only — no KPI summary strip. Good for lists, tables, charts.

createSummaryListRecipe()

Recipe: KPI strip + scrollable list. The most common widget pattern.

createSummaryChartListRecipe()

Recipe: KPI strip + chart + scrollable list. Good for analytics dashboards.

createRailContentRecipe()

Recipe: Side rail + main content area. Good for detail views with navigation.

createRailListRecipe()

Recipe: Side rail + scrollable list. Good for category browsing.

createFeedListRecipe()

Recipe: Activity feed / timeline. Alias for content-only with feed semantics.

./section-helpers

kpiRow()

Create a KPI row with multiple metric cards.
Example:

headlineStat()

Create a headline stat section — a large featured number.
Example:

list()

Create a scrollable list section.
Example:

rowList()

Create a row-list section (compact rows with status dots/icons).
Example:

chart()

Create a chart section (area, line, bar, or sparkline).
Example:

cardList()

Create a card grid section for rich card layouts.
Example:

summaryQuad()

Create a 2x2 summary quad section.
Example:

alert()

Create an alert/banner section.
Example:

tabs()

Create a tabbed content section.
Example:

./testing

extractDataSources()

Extract all DataSource references from a section config tree. Returns a map of sourceId -> Set<field>.

createMockWidgetData()

Generate mock data that matches a WidgetTemplateConfig’s data source shape. Analyzes the section configs to determine which fields are arrays vs scalars, then generates appropriate mock data for each field.
Example:

createEmptyWidgetData()

Generate empty data that matches a WidgetTemplateConfig’s shape. Arrays become [], numbers become 0, strings become "".

createWidgetPreviewStates()

Generate all standard preview states for a widget. Use these to visually test your widget in every possible state — happy path, empty, loading, error, and unconfigured.
Example:

MockDataShape

Describes the shape of mock data generated for a data source.

WidgetPreviewStates

Standard widget preview states for visual testing.