Creating a custom menu item

Check out the Help menu item:

Like the other menu items, if you don't provide a custom application menu template, the Electron shell does this for you at runtime. Let's change that and provide a simple About Editor Component menu item that opens the home page of the SimpleMDE markdown editor component we are using for our application:

  1. First of all, create a new file called menu.js in the project's root folder.
It's good practice to put menus into a separate file so that each time your application needs changing or improving, you can find the menu items quickly.

Here, you need to import the Menu and shell objects ...

Get Electron Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.