Add Backend Toolbar and Actions in Joomla

In Joomla!, the administrator interacts with components through a toolbar. Toolbar is a collection of action buttons (New, Save, Close, Publish and so on). It also creates a title for the component.

Toolbar Buttons

There are many types of toolbar buttons. Each button has option accessors like name, text, task, icon, buttonClass, listCheck and so on.

  1. Link Button: url, target.
  2. Popup Button: url, iframeWidth, iframeHeight, bodyHeight, modalWidth, onclose, title, footer, selector.
  3. Custom Button: html.
  4. Help Button: ref, useComponent, component, url.
  5. Dropdown Button: toggleSplit, toggleButtonClass.
  6. Confirm Button: message


use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;

First, get the toolbar object instance.

$toolbar = Toolbar::getInstance('toolbar');

Standard Buttons

These are Joomla standard buttons: apply, new, save, save-new, save-copy, save-close, featured, publish, unpublish, cancel, trash, delete.

1. Add New Button

To create a button for adding a new record.


2. Dropdown Button

To create a drop down button, first create a dropdown. Then, add child buttons. 

$dropdown = $toolbar->dropdownButton('status-group')
->buttonClass('btn btn-action')

$childBar = $dropdown->getChildToolbar();









The listCheck(true) method activates the button when one or more items are selected from the list. The icon() method sets the icon for the button.