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. You can open a sidebar programmatically, not only from direct UI clicks. As a best practice, still tie openings to clear user or application context: stacking many sidebars without a reason forces repeated dismissal and harms the experience.

ts
import { ui } from "@shopware-ag/meteor-admin-sdk";

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

Usage

ts
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
resizablefalseEnables horizontal resizing of the sidebar6.7.2.0

Return value

Returns a promise without data.

Example

Menu item example

Close an existing sidebar programmatically.

Usage

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

Parameters

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

Return value

Returns a promise without data.

Remove a sidebar completely from the DOM.

Usage

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

Parameters

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

Return value

Returns a promise without data.

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

Set an active sidebar that was already registered with add. Use this when the sidebar exists but is closed or not in front. The Administration shows the panel for the given locationId and loads the content you associated with that id.

Usage:

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

Parameters

NameRequiredDescriptionAvailable at Shopware
locationIdtrueThe id of the sidebar to active6.7.9
Was this page helpful?
UnsatisfiedSatisfied
Be the first to vote!
0.0 / 5  (0 votes)