Skip to main content
The modular dashboard is experimental and its API may change in a future release.
Without admin.dashboard or a custom dashboard view, the Admin Panel opens on a dashboard with a card for each collection the user can read. Configuring admin.dashboard adds your widgets and layouts to that dashboard. An explicit admin.components.views.dashboard always takes precedence over the widget configuration.

Defining Widgets

Register widgets through admin.dashboard.widgets. Each widget has a unique slug and a Component Path. Optional fields appear in the widget edit drawer.

Dashboard options

admin.dashboard is a DashboardConfig: Each entry in widgets is a Widget: WidgetWidth is 'x-small' | 'small' | 'medium' | 'large' | 'x-large' | 'full'.

Creating a Widget Component

Widgets are Server Components. Their request exposes the FrogBot instance at req.frogbot:
Use the color tokens in the widget stylesheet:

Widget component props

Default Layout

defaultLayout accepts an array or a synchronous or asynchronous callback. The callback receives a FrogBotRequest, so it can select a layout using the current user or application data.
Each layout item is a WidgetInstance:

Generated Widget Types

Run frogbot generate:types after registering widget fields. The generated frogbot-types.ts includes an interface for each widget, including its data and allowed widths.
Generated types constrain widgetSlug, data, and width in defaultLayout to the corresponding widget definition.

Built-in Widget

The modular dashboard includes a collections widget. When you do not provide defaultLayout, the dashboard starts with this widget. Its component path is @frogbotai/ui/admin/rsc#CollectionCards when you need to reference it explicitly.

User Customization

From the dashboard editor, users can add widgets, edit widget field values, resize, reorder, and remove widgets. Saving stores the layout in the user’s preferences. Canceling discards unsaved edits. A saved preference takes precedence over defaultLayout. Resetting the layout clears that preference and reapplies the current default layout.