Skip to content

Electron app icon on macOS: .icon, .icns and the grey box

Updated , 6 min read

An Electron app icon on macOS comes from the app bundle, not from your code: set mac.icon in electron-builder (or packagerConfig.icon in Electron Forge) and the packager writes the .icns, plus an Assets.car when you give it an Icon Composer .icon file. On macOS 26 Tahoe and 27 the shape matters too. We built the same Electron 45 app five ways with electron-builder 26.18.0 on macOS 27 on 5 Dec 2026: Electron's default icon and a logo on transparency landed in the grey box, while a full-square PNG and a .icon filled the tile, and the .icon's compiled catalog held light, dark and tinted looks. IconWright is a Mac app that makes app icons: it turns the icon you have (or a sentence about your app) into a layered AppIcon.icon and exports the files an Electron build needs.

How do I set the app icon in electron-builder?

Put the file in your build resources and name it under mac:

"build": {
  "mac": { "icon": "build/AppIcon.icon" }
}

The default is build/icon.icns. mac.icon takes an .icns, a PNG that electron-builder converts, or an Icon Composer .icon; its own option text says a .icon "will be preferred and compiled to an asset catalog". With no icon at all, the app ships Electron's electron.icns, the atom logo, which macOS 27 drew on the grey tile in our test.

What each choice put in Contents/Resources in our builds:

mac.icon Files written Info.plist On macOS 27
none electron.icns CFBundleIconFile grey box
logo PNG on transparency icon.icns CFBundleIconFile grey box
full-square 1024 px PNG icon.icns CFBundleIconFile fills the tile
AppIcon.icon Assets.car, icon.icns CFBundleIconName = Icon, CFBundleIconFile fills the tile; the catalog holds dark and tinted looks

Four builds of the same Electron app as macOS 27 draws them for Finder: no icon set and a logo PNG sit on a grey tile; a full-square PNG and a .icon fill the rounded tile

What size should an Electron app icon be?

Make it 1024 x 1024 px. electron-builder builds every macOS size from it and refuses smaller art: a 256 px PNG stopped our build with "Icon must be at least 512x512 pixels". Its converter wrote ten images, 16 to 1024 px, into icon.icns. For sizes on other systems, see app icon sizes.

The .icon route packs differently. The icon.icns electron-builder made from the .icon held four images, 16, 32, 128 and 256 px, and the larger sizes sit in Assets.car. Apple's actool wrote the same four when we ran it alone at macOS 11 and macOS 26 deployment targets, so that is how Apple's compiler packs a .icon, not an electron-builder choice. We could not check how macOS 15 or earlier draws it on this Mac.

Why is my Electron app icon in a grey box on macOS Tahoe?

Because Tahoe and the macOS releases after it shrink an icon they do not read as filling Apple's rounded square, and put it on a grey tile. The full story, and the fix for apps built with Xcode, is in Mac app icon in a grey box on macOS Tahoe. For Electron our test added one trap you cannot see by looking at the file:

  • An .icns that iconutil packed from Apple's own renders of the icon, 16-bit Display P3 PNGs straight from Icon Composer's renderer, was put in the grey box.
  • The same pixels converted to 8-bit, packed the same way, filled the tile.
  • Swapping sizes one group at a time pointed at the 512 px images (icon_256x256@2x and icon_512x512): 16-bit ones there sent the icon to the grey tile, while a 16-bit 1024 px image alone did not.
  • electron-builder's PNG converter wrote 8-bit images, so the 16-bit 1024 px render given to it as a PNG filled the tile.

So if you build your own .icns with iconutil, check the large PNGs with sips -g bitsPerSample and keep them at 8 bits. The sips recipe in PNG to ICNS and Assets.car on a Mac is safe here: resizing a 16-bit 1024 px PNG to 512 px, sips wrote 8 bits.

How do I use an Icon Composer .icon with Electron?

Give the packager the .icon folder on a Mac with Xcode 26 or later. electron-builder 26.18.0's code checks actool --version and stops with an error below 26.0.0. It then compiles the .icon for macOS with a deployment target of 26.0, writes Assets.car, sets CFBundleIconName to Icon, and keeps an icon.icns from the same compile. assetutil listed light, dark and tintable groups in that Assets.car; a PNG gives one image.

Electron Forge packages with @electron/packager, and its 20.3.1 release reads both files when you leave the extension off: packagerConfig: { icon: 'assets/icon' } with icon.icns and icon.icon side by side. Its option text says the .icns "will be used on macOS < 26 and .icon will be used on macOS >= 26". From its code, the build Mac needs Tahoe or a newer macOS and Xcode 26 whenever it finds the .icon: on an older macOS it stops with "actool .icon support is currently limited to macOS 26 and higher" rather than falling back to the .icns, so build on Tahoe or leave the .icon out. We read that code; we did not run Forge.

Can I ship the Liquid Glass icon without Xcode on the build machine?

Yes: compile once on a Mac with Xcode 26, commit the two files, and let electron-builder copy them. This config, with Xcode out of the build's path, gave the same icon in Finder as the .icon route:

"mac": {
  "icon": "build/AppIcon.icns",
  "extraResources": [{ "from": "build/Assets.car", "to": "Assets.car" }],
  "extendInfo": { "CFBundleIconName": "AppIcon" }
}

The name in CFBundleIconName must match the name the asset catalog was compiled with. More on the two files in PNG to ICNS and Assets.car on a Mac.

Does the BrowserWindow icon change the Mac app icon?

No. Electron's documentation describes the icon option as "the window icon" and gives advice for Windows ICO files; the Dock and Finder read the bundle. app.dock.setIcon(image) "sets the image associated with this dock icon" while the app runs; it takes one image, not the looks of a .icon.

How does IconWright make the Electron icon files?

Drop in the icon you ship today (PNG, JPEG, SVG, .icns, an AppIcon.appiconset, a whole .xcassets folder or an .icon), or describe the app in a sentence and let it draw. From an old flat icon it puts the art on Apple's grid in up to three versions (two when it cannot separate a subject from the background) and shows each in Apple's own render of light, dark, clear and tinted. Export writes, among other files:

  • AppIcon.icon, for mac.icon on a build Mac with Xcode 26.
  • Without Xcode/Assets.car and AppIcon.icns, for the committed-files config above, when Xcode 26 is on the Mac that runs IconWright. With Icon Composer alone it writes the .icns without Assets.car, and redraws every size at 8 bits first, so that .icns filled the tile in our check on macOS 27.
  • Web/icon-1024.png, Apple's 1024 px render, which electron-builder accepts as a PNG and which filled the tile in our test, light look only.

IconWright runs on macOS 15 Sequoia or later and costs $13.99 once. It needs Apple's renderer from Xcode 26 or the free Icon Composer to draw each look, so it does not run on Windows or Linux. For Windows and Linux builds, electron-builder's converter also takes a PNG (256 px or larger for the Windows .ico, from its code).

Questions

What size should an Electron app icon be on macOS?

Start from a 1024 x 1024 px image. electron-builder 26.18 turns a PNG into the .icns for you and stopped our build on a 256 px PNG with "Icon must be at least 512x512 pixels".

Does electron-builder support Icon Composer .icon files?

Yes. Point mac.icon at the .icon folder. In our test with electron-builder 26.18.0 the app got an Assets.car, CFBundleIconName set to Icon, and an icon.icns beside it. The build Mac needs Xcode 26 or later for actool.

Why is my Electron app icon in a grey box on macOS Tahoe?

Its shape is not a full square on Apple's grid, or its large images are ones macOS does not read as one. In our test on macOS 27 Electron's own default icon, a logo on transparency, and an .icns packed from 16-bit renders were all put on the grey tile.

Does the BrowserWindow icon option change the Mac app icon?

No. Electron's documentation describes icon as the window icon and mentions Windows and ICO files. The Mac icon comes from the app bundle; app.dock.setIcon changes the Dock image only while the app runs.