Skip to content
D
Documentation

Dashboard Kit — types

reference
1 min readUpdated

Types

Import these from @grafloria/element.

Types

DashboardSnapshot

A whole board as plain data: every DashboardOptions field except the function seams. dashboard({ ...snapshot, renderWidget }) rebuilds it.

Typed as an Omit rather than a hand-written twin on purpose — a field added to DashboardOptions then joins the snapshot automatically instead of being silently dropped, which is the exact failure this type exists to end.

ts
type DashboardSnapshot = Omit<
  DashboardOptions,
  'renderWidget' | 'onLayoutChange' | 'views'
> & { views: DashboardViewSpec[] };

DragHandleOption

ts
type DragHandleOption = boolean | string | DragGripOptions;

SectionCaption

false/absent: no band. true: the title. A string: that text.

ts
type SectionCaption = false | true | string | SectionCaptionOptions;

WidgetRenderer

The signature every renderer here (and renderWidget) satisfies.

ts
type WidgetRenderer = (widget: DashboardWidgetSpec, host: HTMLElement) => void;

Was this page helpful?