| title | Dashboard |
|---|---|
| description | Dashboard protocol schemas |
{/*
Color variant for dashboard widgets (e.g., KPI cards).
**Source:** `packages/spec/src/ui/dashboard.zod.ts`import { Dashboard, DashboardHeader, DashboardHeaderAction, DashboardWidget, DashboardWidgetOptions, GlobalFilter, GlobalFilterOptionsFrom, WidgetActionType, WidgetColorVariant } from '@objectstack/spec/ui';
import type { Dashboard, DashboardHeader, DashboardHeaderAction, DashboardWidget, DashboardWidgetOptions, GlobalFilter, GlobalFilterOptionsFrom, WidgetActionType, WidgetColorVariant } from '@objectstack/spec/ui';
// Validate data
const result = Dashboard.parse(data);| Property | Type | Required | Description |
|---|---|---|---|
| name | string |
✅ | Dashboard unique name |
| label | string |
✅ | Dashboard label |
| description | string |
optional | Dashboard description |
| header | { showTitle: boolean; showDescription: boolean; actions?: { label: string; actionUrl: string; actionType?: Enum<'script' | 'url' | 'modal' | 'flow' | 'api'>; icon?: string }[] } |
optional | Dashboard header configuration |
| widgets | { id: string; title?: string; description?: string; type: Enum<'bar' | 'horizontal-bar' | 'column' | 'line' | 'area' | 'pie' | 'donut' | 'funnel' | 'scatter' | 'treemap' | 'sankey' | 'gauge' | 'solid-gauge' | 'metric' | 'kpi' | 'bullet' | 'radar' | 'table' | 'pivot'>; … }[] |
✅ | Widgets to display |
| columns | integer |
optional | Number of grid columns (default 12) |
| gap | integer |
optional | Grid gap in Tailwind spacing units |
| refreshInterval | number |
optional | Auto-refresh interval in seconds |
| dateRange | { field?: string; defaultRange: Enum<'today' | 'yesterday' | 'this_week' | 'last_week' | 'this_month' | 'last_month' | 'this_quarter' | 'last_quarter' | 'this_year' | 'last_year' | 'last_7_days' | 'last_30_days' | 'last_90_days' | 'custom'>; allowCustomRange: boolean } |
optional | Global dashboard date range filter configuration |
| globalFilters | { name?: string; field: string; label?: string; type?: Enum<'text' | 'select' | 'date' | 'number' | 'lookup'>; … }[] |
optional | Global filters that apply to all widgets in the dashboard |
| aria | { ariaLabel?: string; ariaDescribedBy?: string; role?: string } |
optional | ARIA accessibility attributes |
| performance | { lazyLoad?: boolean; virtualScroll?: object; cacheStrategy?: Enum<'none' | 'cache-first' | 'network-first' | 'stale-while-revalidate'>; prefetch?: boolean; … } |
optional | Performance optimization settings |
| protection | { lock: Enum<'none' | 'no-overlay' | 'no-delete' | 'full'>; reason: string; docsUrl?: string } |
optional | Package author protection block — lock policy for this dashboard. |
| _lock | Enum<'none' | 'no-overlay' | 'no-delete' | 'full'> |
optional | Item-level lock — controls overlay & delete (ADR-0010). |
| _lockReason | string |
optional | Human-readable reason shown when a write is refused by _lock. |
| _lockSource | Enum<'artifact' | 'package' | 'env-forced'> |
optional | Layer that set _lock (artifact | package | env-forced). |
| _provenance | Enum<'package' | 'org' | 'env-forced'> |
optional | Origin of the item (package | org | env-forced). |
| _packageId | string |
optional | Owning package machine id. |
| _packageVersion | string |
optional | Owning package version. |
| _lockDocsUrl | string |
optional | Optional documentation link surfaced next to _lockReason. |
Dashboard header configuration
| Property | Type | Required | Description |
|---|---|---|---|
| showTitle | boolean |
✅ | Show dashboard title in header |
| showDescription | boolean |
✅ | Show dashboard description in header |
| actions | { label: string; actionUrl: string; actionType?: Enum<'script' | 'url' | 'modal' | 'flow' | 'api'>; icon?: string }[] |
optional | Header action buttons |
Dashboard header action
| Property | Type | Required | Description |
|---|---|---|---|
| label | string |
✅ | Action button label |
| actionUrl | string |
✅ | URL or target for the action |
| actionType | Enum<'script' | 'url' | 'modal' | 'flow' | 'api'> |
optional | Type of action |
| icon | string |
optional | Icon identifier for the action button |
| Property | Type | Required | Description |
|---|---|---|---|
| id | string |
✅ | Unique widget identifier (snake_case) |
| title | string |
optional | Widget title |
| description | string |
optional | Widget description text below the header |
| type | Enum<'bar' | 'horizontal-bar' | 'column' | 'line' | 'area' | 'pie' | 'donut' | 'funnel' | 'scatter' | 'treemap' | 'sankey' | 'gauge' | 'solid-gauge' | 'metric' | 'kpi' | 'bullet' | 'radar' | 'table' | 'pivot'> |
✅ | Visualization type |
| chartConfig | { type: Enum<'bar' | 'horizontal-bar' | 'column' | 'line' | 'area' | 'pie' | 'donut' | 'funnel' | 'scatter' | 'treemap' | 'sankey' | 'gauge' | 'solid-gauge' | 'metric' | 'kpi' | 'bullet' | 'radar' | 'table' | 'pivot'>; title?: string; subtitle?: string; description?: string; … } |
optional | Chart visualization configuration |
| colorVariant | Enum<'default' | 'blue' | 'teal' | 'orange' | 'purple' | 'success' | 'warning' | 'danger'> |
optional | Widget color variant for theming |
| requiresObject | string |
optional | Hide the widget unless the named object is registered |
| requiresService | string |
optional | Hide the widget unless the named kernel service is registered |
| actionUrl | string |
optional | URL or target for the widget action button |
| actionType | Enum<'script' | 'url' | 'modal' | 'flow' | 'api'> |
optional | Type of action for the widget action button |
| actionIcon | string |
optional | Icon identifier for the widget action button |
| filter | any |
optional | Presentation-scope filter (runtimeFilter) |
| compareTo | 'previousPeriod' | 'previousYear' | { offset: string } |
optional | Period-over-period comparison window |
| dataset | string |
✅ | Dataset name to bind (ADR-0021) |
| dimensions | string[] |
optional | Dimension names — X/group/split |
| values | string[] |
✅ | Measure names — Y (at least one) |
| layout | { x: number; y: number; w: number; h: number } |
optional | Grid layout position (auto-flowed when omitted) |
| options | Record<string, any> |
optional | Widget specific configuration |
| filterBindings | Record<string, string | 'false'> |
optional | Per-widget dashboard-filter bindings: filter name → this widget's field, or false to opt out |
| suppressWarnings | string[] |
optional | Build diagnostic rule ids suppressed on this widget |
| responsive | { breakpoint?: Enum<'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'>; hiddenOn?: Enum<'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'>[]; columns?: object; order?: object } |
optional | Responsive layout configuration |
| aria | { ariaLabel?: string; ariaDescribedBy?: string; role?: string } |
optional | ARIA accessibility attributes |
Widget configuration — declared query keys + open renderer extras
| Property | Type | Required | Description |
|---|---|---|---|
| dateGranularity | Enum<'day' | 'week' | 'month' | 'quarter' | 'year'> |
optional | Bucket selected date dimensions (day/week/month/quarter/year) |
| sortBy | string |
optional | Dimension/measure name to order by |
| sortOrder | Enum<'asc' | 'desc'> |
optional | Sort direction for sortBy |
| limit | integer |
optional | Max rows (applied after ordering) |
| stageOrder | string | number | boolean[] |
optional | Explicit category order for funnel/pyramid stages (stored values) |
| Property | Type | Required | Description |
|---|---|---|---|
| name | string |
optional | Stable filter name (variable key); defaults to field |
| field | string |
✅ | Field name to filter on |
| label | string |
optional | Display label for the filter |
| type | Enum<'text' | 'select' | 'date' | 'number' | 'lookup'> |
optional | Filter input type |
| options | { value: string | number | boolean; label: string }[] |
optional | Static filter options |
| optionsFrom | { object: string; valueField: string; labelField: string; filter?: any } |
optional | Dynamic filter options from object |
| defaultValue | string | number | boolean |
optional | Default filter value |
| scope | Enum<'dashboard' | 'widget'> |
✅ | Filter application scope |
| targetWidgets | string[] |
optional | Widget IDs to apply this filter to |
Dynamic filter options from object
| Property | Type | Required | Description |
|---|---|---|---|
| object | string |
✅ | Source object name |
| valueField | string |
✅ | Field to use as option value |
| labelField | string |
✅ | Field to use as option label |
| filter | any |
optional | Filter to apply to source object |
Widget action type
scripturlmodalflowapi
Widget color variant
defaultbluetealorangepurplesuccesswarningdanger