• Version 9.4.0
  • Published
  • 721 kB
  • 1 dependency
  • BSD-2-Clause license


npm i menubar
yarn add menubar
pnpm add menubar


high level way to create menubar desktop applications with electron



function getWindowPosition

getWindowPosition: (tray: Tray) => WindowPosition;
  • Depending on where the taskbar is, determine where the window should be positioned.

    Parameter tray

    The Electron Tray instance.

menubar: (options?: Partial<Options>) => Menubar;
  • Factory function to create a menubar application

    Parameter options

    Options for creating a menubar application, see Options

function taskbarLocation

taskbarLocation: (tray: Tray) => TaskbarLocation;
  • Determine taskbard location: "top", "bottom", "left" or "right".

    Only tested on Windows for now, and only used in Windows.

    Parameter tray

    The Electron Tray instance.


class Menubar extends EventEmitter {}
  • The main Menubar class.

constructor(app: Electron.App, options?: Partial<Options>);
    readonly app: Electron.App;
    • The Electron [App]( instance.

    readonly positioner: Positioner;
    • The [electron-positioner]( instance.

    readonly tray: Tray;
    • The Electron [Tray]( instance.

    readonly window: any;
    • The Electron [BrowserWindow]( instance, if it's present.

    getOption: <K extends keyof Options>(key: K) => Options[K];
    • Retrieve a menubar option.

      Parameter key

      The option key to retrieve, see Options.

    hideWindow: () => void;
    • Hide the menubar window.

    setOption: <K extends keyof Options>(key: K, value: Options[K]) => void;
    • Change an option after menubar is created.

      Parameter key

      The option key to modify, see Options.

      Parameter value

      The value to set.

    showWindow: (trayPos?: Electron.Rectangle) => Promise<void>;
    • Show the menubar window.

      Parameter trayPos

      The bounds to show the window in.

    Package Files (3)

    Dependencies (1)

    Dev Dependencies (11)

    Peer Dependencies (1)


    To add a badge like this badgeto your package's README, use the codes available below.

    You may also use to create a custom badge linking to

    • Markdown
    • HTML
      <a href=""><img src="" alt=""></a>