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:
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
Dropdown Menu
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.
Practical Examples
Export Button
Sync Button with Loading State
Conditional Action Bar Items
You can conditionally show action bar items based on the entity or user permissions:
Multiple Action Bar Items
You can add multiple action bar items to the same page:
Available Button Variants
The dashboard provides several button variants you can use:
default- Primary button stylesecondary- Secondary button styleoutline- Outlined button styleghost- Minimal button styledestructive- For destructive actions (delete, etc.)
Best Practices
- Use appropriate icons: Icons help users quickly understand the action
- Provide loading states: Show loading indicators for async operations
- Handle errors gracefully: Use toast notifications for feedback
- Consider permissions: Use
PermissionGuardfor actions that require specific permissions - Keep labels concise: Use short, descriptive labels for buttons
- Group related actions: Consider the order and grouping of multiple action items
- Test thoroughly: Verify your actions work correctly across different entity states
Finding Page IDs
To find the pageId for your action bar items:
- Enable Dev Mode in the dashboard
- Navigate to the page where you want to add your action
- The page ID will be shown in the dev mode overlay
- Use this ID in your action bar item configuration
Was this chapter helpful?

