Skip to main content

Action Bar Items

The Action Bar is the bar at the top of the page where you can add buttons and other actions.

Info

All available options are documented in the DashboardActionBarItem reference

Basic Action Bar Item

Here's a simple example of adding a button to the action bar:

src/plugins/my-plugin/dashboard/index.tsx
Action bar button

Context Data

The context prop provides access to:

  • entity: The current entity being viewed/edited (e.g., Product, Customer, etc.)
  • form: The React Hook Form instance for the current page (if applicable)
  • route: Route information and parameters

You can also define dropdown menu items for the Action Bar. This is useful for secondary actions that are needed less often by administrators.

Make sure to always wrap these in the DropdownMenuItem component for consistent styling.

Tsx
Action bar dropdown

Practical Examples

Export Button

src/plugins/my-plugin/dashboard/index.tsx

Sync Button with Loading State

src/plugins/my-plugin/dashboard/index.tsx

Conditional Action Bar Items

You can conditionally show action bar items based on the entity or user permissions:

src/plugins/my-plugin/dashboard/index.tsx

Multiple Action Bar Items

You can add multiple action bar items to the same page:

src/plugins/my-plugin/dashboard/index.tsx

Available Button Variants

The dashboard provides several button variants you can use:

  • default - Primary button style
  • secondary - Secondary button style
  • outline - Outlined button style
  • ghost - Minimal button style
  • destructive - For destructive actions (delete, etc.)
Tsx

Best Practices

  1. Use appropriate icons: Icons help users quickly understand the action
  2. Provide loading states: Show loading indicators for async operations
  3. Handle errors gracefully: Use toast notifications for feedback
  4. Consider permissions: Use PermissionGuard for actions that require specific permissions
  5. Keep labels concise: Use short, descriptive labels for buttons
  6. Group related actions: Consider the order and grouping of multiple action items
  7. Test thoroughly: Verify your actions work correctly across different entity states

Finding Page IDs

To find the pageId for your action bar items:

  1. Enable Dev Mode in the dashboard
  2. Navigate to the page where you want to add your action
  3. The page ID will be shown in the dev mode overlay
  4. Use this ID in your action bar item configuration
Was this chapter helpful?
Report Issue
Edited Feb 23, 2026ยทEdit this page