electron-menubar gives you a tray icon and a popup window with a single menubar() call. This guide installs the package and runs a minimal app with Electron.
electron-menubar requires electron version 35.0.0 or later as a peer
dependency.Installation
Usage
1
Create the project files
Starting with your own new project, run these commands:
2
Write your app
Fill The package ships both CommonJS and ESM entry points with TypeScript declarations, so you can also use
index.html with some HTML, and myApp.js like this:myApp.js
import { menubar } from 'electron-menubar'.3
Run the app
Then use
electron to run the app:index.html from the app source directory (process.cwd()) and uses IconTemplate.png from the same directory as the tray icon. See Options to change these.
Next steps
Options
Configure the window, icon, position, and triggers.
Examples
Explore working example apps.