UI configuration
Native, visible OS integrations — window sizing, tray icon, application/context/dock menus, the Windows Jump List, and the splash screen — everything under browserWindow and ui in electron.config.ts. All of it is off by default except window sizing, because it changes visible OS behavior.
Window options (browserWindow)
Pass-through for Electron's BrowserWindowConstructorOptions:
| Key | Default |
|---|---|
width |
1200 |
height |
800 |
minWidth / minHeight |
— |
icon |
— |
webPreferences |
Merged with this package's managed defaults. preload, contextIsolation, nodeIntegration are not configurable here — the bridge depends on them. sandbox can be set false if you need full Node.js access in the preload. |
Application menu (ui.appMenu)
| Key | Default | Purpose |
|---|---|---|
enabled |
false |
Enable the application menu. |
hide |
false |
Hide the application menu. On macOS a minimal Quit menu is kept. |
editMenu |
true |
Include standard Edit menu (Undo, Redo, Cut, Copy, Paste, Select All). |
viewMenu |
true in dev, false in production |
Include View menu (Reload, Toggle DevTools, Zoom). |
Renderer context menu (ui.contextMenu)
{ enabled: boolean }, default false. When enabled, window.Electron.showContextMenu(options) shows a native context menu; the preload bridge already forwards every right-click's target (element id, classes, data-*, nearby link/media/form) so main-process menu-building code can react to what was actually clicked.
Tray icon (ui.trayMenu)
| Key | Purpose |
|---|---|
enabled |
Default false. |
icon |
Path to the tray icon, relative to the project root or absolute. |
tooltip |
Tooltip text shown on hover. |
minimizeToTray |
Hide the window to tray instead of quitting on close. Default false. |
macOS Dock menu (ui.dockMenu)
{ enabled, hideIcon } — macOS only. hideIcon is useful for pure menu-bar/tray apps that shouldn't show a Dock icon at all.
Windows Jump List (ui.jumpList)
{ enabled: boolean } — Windows only, the right-click menu on the taskbar icon. No visible effect on macOS/Linux. Default false.
Splash screen (ui.splashScreen)
| Key | Default | Purpose |
|---|---|---|
image |
— (required to enable) | Splash image. Supports PNG, JPEG, WebP, GIF, SVG. Omitting it disables the splash screen entirely. |
width |
400 |
|
height |
300 |
|
backgroundColor |
'#ffffff' |
Any CSS color, or 'transparent'. |
minDisplayTime |
0 |
Minimum time the splash stays visible, in ms. |
Launch at login
Not a config key — driven at runtime by window.Electron.autoLaunch.isEnabled() / .setEnabled() / .getSettings(). macOS/Windows only; on Linux both resolve { ok: false, error: { code: 'UNSUPPORTED_OS' } }.
Example
browserWindow: {
width: 1200,
height: 800,
},
ui: {
trayMenu: { enabled: true, icon: 'assets/tray.png', tooltip: 'My App' },
appMenu: { enabled: true },
contextMenu: { enabled: true },
},
This mirrors what playground/electron.config.ts enables (appMenu, contextMenu, jumpList) so the demo app's Menu page has something to exercise — see Playground demo app.
Next: App & lifecycle · Security · Processes configuration