Widget.* compound API for consistent styling and behavior.
Basic widget
Widget declaration
id— globally unique; prefix with your slug to avoid collisionswidgetState— required:'active','inactive', or'disabled'.id,name,component, andwidgetStateare the only required fieldssize—'compact','half'or'full'. Wins overlayoutswhen both are setlayouts— a box per breakpoint (lg,md,sm);gridSizeandgridPositionare the older equivalents and still accepted. Today the dashboard reads onlylg.w(over 6 columns is full width, 3 or under is compact, anything else is half) andlg.maxHeight. Position comes from the order the dashboard lays widgets out in, sox,y,hand themdandsmboxes are accepted but not usedisPinnable— reachesWidgetContextand adds “Pin to board” / “Unpin from board” to theWidget.Header⋯ menu
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 isactive, 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:
With TanStack Query, pass the query itself and
Widget.DataState works out the status and all three:
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 thepx-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, andchildren, 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.
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’sonRefresh - Pin to board / Unpin from board — when the widget declares
isPinnable
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 inWidget.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.
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 insideWidget.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 fetchclientReadable storage keys:
clientReadable: true are simply absent from the result, as are keys never written. See Storage.
Styling
Use semantic Tailwind classes (Ekanos design tokens):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 inWidgetPreviewProvider 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
loadingyou pass toWidget.DataStateeventually becomesfalse - Your query’s enabled flag reads the integration state from
WidgetContextoutsideWidget.DataState fetchIntegrationStorage()keys haveclientReadable: 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
- Marketplace tile — card for the integration marketplace
- Activation form — connect form
- Testing — test widgets