activityBarRegistry
MS Code Extension API / core/extensionAPI/registry/activityBarRegistry
core/extensionAPI/registry/activityBarRegistry
Interfaces
ActivityBarItem
Defined in: core/extensionAPI/registry/activityBarRegistry.ts:15
A single item in the Activity Bar.
onClick behaviour:
- If openSidebarContent === true → sidebar panel opens (shows sidebarComponent or default label)
- If openSidebarContent === false → onClick fires freely (open palette, context menu, etc.)
- Both can coexist: onClick always fires; sidebar visibility is controlled separately
Properties
icon
icon:
string
Defined in: core/extensionAPI/registry/activityBarRegistry.ts:20
Icon name passed to <Icon> (codicon or custom SVG name)
id
id:
string
Defined in: core/extensionAPI/registry/activityBarRegistry.ts:17
Unique panel / action ID — used as activePanel key
label
label:
string
Defined in: core/extensionAPI/registry/activityBarRegistry.ts:23
Tooltip + default sidebar heading when no component is provided
onClick?
optionalonClick?: () =>void
Defined in: core/extensionAPI/registry/activityBarRegistry.ts:58
Called every time the icon is clicked (regardless of openSidebarContent). Use for: opening palette, showing context menu, auth flows, etc.
Returns
void
openSidebarContent?
optionalopenSidebarContent?:boolean
Defined in: core/extensionAPI/registry/activityBarRegistry.ts:45
If true, clicking this item toggles a sidebar panel.
The panel renders sidebarComponent if provided,
otherwise a default centered label.
Default
false
position?
optionalposition?:"top"|"bottom"
Defined in: core/extensionAPI/registry/activityBarRegistry.ts:37
Where the icon sits.
Default
'top'
priority
priority:
number
Defined in: core/extensionAPI/registry/activityBarRegistry.ts:31
Lower number = higher up the bar. Convention: top items: 10, 20, 30 … bottom items: negative or use position:'bottom'
sidebarComponent?
optionalsidebarComponent?:ComponentType<{ }>
Defined in: core/extensionAPI/registry/activityBarRegistry.ts:52
The React component rendered inside the sidebar panel. Only used when openSidebarContent === true. Pass undefined to get the built-in "no content" fallback.
Variables
activityBarRegistry
constactivityBarRegistry:ActivityBarRegistry
Defined in: core/extensionAPI/registry/activityBarRegistry.ts:109