Toolbar2 upgrade guide
This page is a guide to upgrading from the Toolbar 1 API to the new API.
Toolbar 2
Only AUI buttons are supported
Toolbar 1 supported Dropdown 1, <aui-dropdown-menu>, buttons, anchors and inputs. Toolbar 2 only supports AUI buttons (which includes <aui-dropdown-menu> and link buttons).
It is easiest to starting by upgrading the Dropdown component.
If you need to support more, you can use a flex or grid layout generator, e.g. Angry tools - CSS Flex Layout.
Initialisation
Toolbar is pure CSS and is loaded via web-resource dependencies. It should be loaded at the same time as HTML is put on the page to avoid layout shift.
To migrate, find all instances of com.atlassian.auiplugin:toolbar
and replace it with com.atlassian.auiplugin:aui-toolbar2
.
HTML changes
- Replace the
aui-toolbar
class withaui-toolbar2
- Add the
role="toolbar"
attribute to the parent element - Add a
<div class="aui-toolbar2-inner">
element - Replace the
toolbar-split toolbar-split-row
classes with the new row classaui-toolbar2-group
- Replace the old side alignment
toolbar-split toolbar-split-left
classes with theaui-toolbar2-primary
class - Replace the old side alignment
toolbar-split toolbar-split-right
classes with theaui-toolbar2-secondary
class - Replace
<ul class="toolbar-group">
with<div class="aui-buttons">
elements - Remove the
<li class="toolbar-item">
wrapper elements
Old API | New API |
---|---|
|
|