Skip to main content

Function: createStatusBarItem()

createStatusBarItem(alignment?, priority?): StatusBarItem

Creates a status bar StatusBarItem item.

Parameters

alignment?

StatusBarAlignment

The alignment of the item.

priority?

number

The priority of the item. Higher values mean more to the left or more to the right.

Returns

StatusBarItem

A new status bar item.

Example

import * as api from '@podman-desktop/api';

export async function activate(extensionContext: api.ExtensionContext): Promise<void> {
const statusBarItem = api.window.createStatusBarItem();
statusBarItem.text = 'Information';
statusBarItem.tooltip = 'A problem occured';
statusBarItem.command = 'extension-name.my-command';
statusBarItem.iconClass = 'fa fa-exclamation-triangle';
extensionContext.subscriptions.push(
api.commands.registerCommand('extension-name.my-command', () => { console.log('command executed'); }),
statusBarItem,
);
statusBarItem.show();
}

Defined in

packages/extension-api/src/extension-api.d.ts:2236