Skip to content

Sidebars

A sidebar provides a contextual panel that displays at the right edge of the Administration window. Unlike modals, sidebars allow users to view and interact with additional content or functionality without losing context of the main interface. Sidebars should be opened in response to user interaction rather than appearing automatically. As a best practice, avoid opening sidebars without clear user context - for example, automatically displaying extension changelog sidebars immediately after login creates a poor user experience by requiring manual dismissal of each one.

Add a sidebar

Add a new sidebar. The content of the sidebar is determined by your locationId.

Usage:

ts
sw.ui.sidebar.add({
    title: 'Awesome Chat Bot',
    locationId: 'sidebar-chat-bot',
    icon: 'regular-sparkles',
});

Parameters

NameRequiredDescriptionAvailable at Shopware
titletrueThe title of the sidebar6.7
locationIdtrueThe id for the content of the sidebar6.7
icontrueThe icon to display in the sidebar. You can use any icon from the Shopware icon library6.7

Example

Menu item example

Close a sidebar

Close an existing sidebar programmatically.

Usage:

ts
sw.ui.sidebar.close({
    locationId: 'sidebar-chat-bot',
});

Parameters

NameRequiredDescriptionAvailable at Shopware
locationIdtrueThe id of the sidebar to close6.7

Remove a sidebar

Remove a sidebar completely from the DOM.

Usage:

ts
sw.ui.sidebar.remove({
    locationId: 'sidebar-chat-bot',
});

Parameters

NameRequiredDescriptionAvailable at Shopware
locationIdtrueThe id of the sidebar to remove6.7