Skip to content

Sidebar

SidebarItem

SidebarItem = object

Represents a sidebar item.

Properties

setCount()

setCount: (count: number) => void

Set the value of a notification badge next to the sidebar item.

Parameters
ParameterTypeDescription
countnumberThe number to display in the badge. A value of 0 will hide the badge.
Returns

void


SidebarSDK

SidebarSDK = object

Utilities to interact with the sidebar.

Properties

registerItem()

registerItem: (name: string, path: string, options?: object) => SidebarItem

Register a sidebar item.

Parameters
ParameterTypeDescription
namestringThe name of the sidebar item.
pathstringThe path that the user will be navigated to when the sidebar item is clicked.
options?{ group?: string; icon?: Icon; isExternal?: boolean; }Options for the sidebar item.
options.group?stringThe group the sidebar item belongs to.
options.icon?IconThe Icon of the sidebar item.
options.isExternal?booleanWhether the path points to an external URL.
Returns

SidebarItem

The created sidebar item.

Example
ts
sdk.sidebar.registerItem("My Plugin", "/my-plugin-page", {
  icon: "fas fa-rocket",
});