Dashboard Widgets
The Dashboard is the first page users see when they log into the Payload Admin Panel. By default, it displays cards with the collections and globals. You can customize the dashboard by adding widgets - modular components that can display data, analytics, or any other content.
One of the coolest things about widgets is that each plugin can define its own. Some examples:
- Analytics
- Error Reporting
- Number of documents that meet a certain filter
- Jobs recently executed
Defining Widgets
Define widgets in your Payload config using the admin.dashboard.widgets property:
Widget Configuration
Property | Type | Description |
|---|---|---|
| | Unique identifier for the widget |
| | Path to the widget component (supports |
| | Optional widget-specific form fields shown in the edit drawer |
| | Minimum width the widget can be resized to (default: |
| | Maximum width the widget can be resized to (default: |
WidgetWidth Values: 'x-small' | 'small' | 'medium' | 'large' | 'x-large' | 'full'.
Creating a Widget Component
Widgets are React Server Components that receive WidgetServerProps:
For visual consistency with the Payload UI, we recommend:
- Using the
cardclass for your root element, unless you don't want it to have a background color. - Using our theme variables for backgrounds and text colors. For example, use
var(--theme-elevation-0)for backgrounds andvar(--theme-text)for text colors.
Default Layout
Control the initial dashboard layout with the defaultLayout property:
The defaultLayout function receives the request object and should return an array of WidgetInstance objects.
If your widget has fields, you can type widgetData with generated widget types:
WidgetInstance Type
Property | Type | Description |
|---|---|---|
| | Slug of the widget to display |
| | Optional widget-specific data passed to |
| | Initial width of the widget (default: minWidth) |
width is constrained by each widget's minWidth and maxWidth when types are generated.
Built-in Widgets
Payload includes a built-in collections widget that displays collection and global cards.
If you don't define a defaultLayout, the collections widget will be automatically included in your dashboard.
User Customization
Users can customize their dashboard by:
- Clicking the dashboard dropdown in the breadcrumb
- Selecting "Edit Dashboard"
- Adding widgets via the "Add +" button
- Editing widget data (for widgets with
fields) via the edit button - Resizing widgets using the width dropdown on each widget (if multiple widths are allowed)
- Reordering widgets via drag-and-drop
- Deleting widgets using the delete button
- Saving changes or canceling to revert
Users can also reset their dashboard to the default layout using the "Reset Layout" option.
Was this page helpful?