Skip to main content
Widgets are client components that render on the Ekanos dashboard. Use the Widget.* compound API for consistent styling and behavior.

Basic widget

Widget declaration

  • id — globally unique; prefix with your slug to avoid collisions
  • widgetState — required: 'active', 'inactive', or 'disabled'. id, name, component, and widgetState are the only required fields
  • size — 'compact', 'half' or 'full'. Wins over layouts when both are set
  • layouts — a box per breakpoint (lg, md, sm); gridSize and gridPosition are the older equivalents and still accepted. Today the dashboard reads only lg.w (over 6 columns is full width, 3 or under is compact, anything else is half) and lg.maxHeight. Position comes from the order the dashboard lays widgets out in, so x, y, h and the md and sm boxes are accepted but not used
  • isPinnable — reaches WidgetContext and adds “Pin to board” / “Unpin from board” to the Widget.Header ⋯ menu
Fields the platform populates at runtime (productId, widgetConfigId, workspaceId, isPinned, health, integrationMetadata) are rejected in a declaration.
  • access — optional. What the widget reads and which actions it offers, so admins see it and agent access can be suggested from it. See Access

Widget API

Widget.DataState

Overrides the render state with your widget’s own data state — only while the integration itself is active, so inactive/disabled still win. status is one of ready, loading, error or inactive; inactive forces the inactive state (for example, activated but the upstream connection is missing). The loading, error and inactive booleans it replaces are deprecated:
Three optional props opt the widget into the shared refresh and freshness chrome: With TanStack Query, pass the query itself and Widget.DataState works out the status and all three:
A failed background refresh keeps the card on its rows (ready), and the footer says how old they are; only a read that failed with nothing on screen shows the error view. A widget waiting on an OAuth connection also passes the useOAuthWidgetGate result as connection, which adds inactive (not connected) and waits for the check. Explicit status, onRefresh, refreshing and updatedAt still win over what query gives. Pass none of them and the widget behaves as before. The host cannot see your queries, so each affordance appears only when you supply what it needs.

Widget.Card

The card container: the stock card, with its header, body and footers padding themselves so a chart or table can run to its edges. Insets use the px-card and py-row density tokens, so a Source’s density reaches your widget; use them in your own markup instead of px-5.

Widget.Header

Inset header, a stock card header: the title and description on the left, and children, the ⋯ menu and the collapse button together on the right. title, subtitle, and description (shown as a tooltip) override the provider’s values; children render on the right. It renders nothing when there is no title from either source.
Every Widget.Header also renders a ⋯ menu with the actions that apply. With none of them applicable, the menu does not render:
  • Open in workspace — when the host sets WidgetMeta.openHref
  • Refresh — when the widget reports a refresh through Widget.DataState’s onRefresh
  • Pin to board / Unpin from board — when the widget declares isPinnable
Add your own items with the menu prop and Widget.MenuItem. They sit at the top of the menu. Use them for occasional actions such as “Open in QuickBooks”, and keep children for controls people use on every visit, like filters, so the header does not carry a row of buttons plus the menu.
Widget.MenuItem takes href (a link; external opens it in a new tab), onSelect, disabled, and icon (a Phosphor icon name such as envelope).

Widget.Active

Content area. It adds no padding, so content runs edge to edge. Wrap text in Widget.Body for standard padding:

Widget.Body

Padded flex-column container (px-card pb-card gap-4; the header supplies the top inset). Pass flush for content that pads itself or runs to the edges (rows, a chart, a table), which drops the padding:

Other parts

Widget.Inactive and Widget.Disabled render for those states (with default content if you pass no children), Widget.Footer renders only while active and is the stock card footer, Widget.Actions is a card footer with its content aligned right, Widget.AskFooter renders the “Ask about this” bar, and Widget.HealthFooter shows a stale-data notice when the integration is degraded, including when it last synced (from WidgetHealth.lastSuccessAt) when that is known. The empty, inactive, error and disabled states draw the kit’s inline EmptyNote, and the full-body loading spinner is the kit Spinner. Widget.Empty is the one for an active widget with nothing to list. It takes tone (positive, the default, or neutral), title, description, action and icon, a Phosphor icon name such as tray. Without icon it draws a check for positive and a tray for neutral.
Every Widget.* part must render inside a widget provider. Outside one it throws Widget.* compound components must be rendered inside a widget provider. — the host supplies one on the dashboard; elsewhere use WidgetPreviewProvider.

WidgetInactiveState

Widget.Inactive draws the not connected, no access and setup needed states. WidgetInactiveState is the renderer underneath it, exported from @ekanos/sdk/components. Use it directly when you need to show one of those states somewhere Widget.Inactive does not apply: inside Widget.Active (for example when one panel of a connected widget needs extra setup), or on a routed page that has no widget context.

Recovering from errors

The error boundary inside Widget.Active catches a crashing widget and offers a “Try again” button that re-mounts it (and reloads its data when the widget reports a refresh), instead of telling the user to reload the page. The default Widget.Error view shows the same “Try again” button when you pass onRefresh to Widget.DataState.

WidgetContext

Access widget metadata and state:
WidgetContextValue also has an optional data field (WidgetData: updatedAt, refreshing, refresh), filled from Widget.DataState’s props, and ctx.meta.openHref. Both types are exported from @ekanos/sdk/components. Custom providers that build a WidgetContextValue keep compiling unchanged. Read ctx?.state.state outside Widget.DataState to gate data fetching on the integration being active. ctx.meta carries widgetId, title, isPinnable, aiFooterEnabled, and related display fields.

Reading storage

Widgets fetch clientReadable storage keys:
Keys without clientReadable: true are simply absent from the result, as are keys never written. See Storage.

Styling

Use semantic Tailwind classes (Ekanos design tokens):
Avoid bg-white, text-black, or hex colors. See Styling for loading the token layer outside Ekanos.

Common patterns

Chart widget

Data table widget

Testing widgets

Wrap in WidgetPreviewProvider to render without the host. It fills the same WidgetContext with local state and no persistence; state defaults to 'active':

Troubleshooting

Widget ID collision

Widget IDs are globally unique. Prefix with your slug: acme-payments-summary, not just summary.

Widget always loading

Check:
  • The loading you pass to Widget.DataState eventually becomes false
  • Your query’s enabled flag reads the integration state from WidgetContext outside Widget.DataState
  • fetchIntegrationStorage() keys have clientReadable: true (absent keys come back as missing, not as an error)

Styling looks wrong

Outside Ekanos, load the @ekanos/ui token layer — see Styling. Use semantic classes (bg-card, text-foreground), not hardcoded colors.

Next steps