How to remove menu bar from Electron app?

Sometimes, we want to remove menu bar from Electron app.

In this article, we’ll look at how to remove menu bar from Electron app.

How to remove menu bar from Electron app?

To remove menu bar from Electron app, we can set the autoHideMenuBar to true.

For instance, we write

const mainWindow = new BrowserWindow({
  autoHideMenuBar: true,
})

to create a BrowserWindow instance by passing in an object with autoHideMenuBar set to true.

As a result, the menu bar would be hidden in the app.

Conclusion

To remove menu bar from Electron app, we can set the autoHideMenuBar to true.