Skip to content

components/all-windows-status-bar-item-component

Shows one status-bar item in the main window and in every desktop popout, including popouts opened later, and removes only its own items when a window closes or the component unloads.

Read from Obsidian 1.15.1: the main window builds body > .app-container > .status-bar, and Plugin.addStatusBarItem is a .status-bar-item created in it. A popout builds body > .app-container with the workspace only, and no status bar. app.css styles .status-bar without scoping it to a window, so a .status-bar created inside a popout’s .app-container looks and sits exactly like the main one. By default this component creates that bar in a popout that lacks one, and marks it with WINDOW_STATUS_BAR_CSS_CLASS. The marker is a wire constant shared by every copy of this library: any copy reuses a marked bar, and whichever copy removes the last item from it removes the bar too.

Mobile has no popouts, and app.css hides .status-bar under .is-mobile, so on mobile the component creates nothing and never calls the render callback.

Class Description
AllWindowsStatusBarItemComponent Shows one status-bar item in the main window and in every desktop popout while loaded.
Interface Description
AllWindowsStatusBarItemComponentConstructorParams Parameters for the AllWindowsStatusBarItemComponent constructor.
AllWindowsStatusBarItemRenderParams Parameters passed to AllWindowsStatusBarItemComponentConstructorParams.render.
RegisterAllWindowsStatusBarItemParams Parameters for registerAllWindowsStatusBarItem.
Function Description
getPluginStatusBarItemCssClass Gets the class Plugin.addStatusBarItem adds to a plugin’s status-bar items. It copies Obsidian 1.15.1 exactly, including that only the first disallowed character is replaced.
registerAllWindowsStatusBarItem Shows one status-bar item in the main window and in every desktop popout, including popouts opened later, until the owning component unloads.
Variable Description
WINDOW_STATUS_BAR_CSS_CLASS The class that marks a status bar this library created in a window that had none. Other copies of the library match it, so its value must never change.