Skip to content

Application Icons

Introduction

Configure your Applications icons. These icons are used for the icon of your app in the app switcher and in the file system like on your Desktop or in the Applications folder.

MacOS

Electrobun supports either a traditional icon.iconset folder or a modern .icon file created with Apple’s Icon Composer.

Read Apple’s developer docs for more details.

Using icon.iconset

You should include different icon sizes in your icon.iconset folder. We recommend the following sizes and naming convention:

icon_16x16.png
icon_16x16@2x.png
icon_32x32.png
icon_32x32@2x.png
icon_128x128.png
icon_128x128@2x.png
icon_256x256.png
icon_256x256@2x.png
icon_512x512.png
icon_512x512@2x.png

You can specify a custom path for the icon.iconset folder in your electrobun.config file.

electrobun.config.ts
const config: ElectrobunConfig = {
build: {
mac: {
icons: "icon.iconset",
},
},
};

Using .icon files from Icon Composer

You can also point build.mac.icons at a .icon file generated by Apple’s Icon Composer. Electrobun compiles it during the build and wires up the required macOS bundle metadata automatically.

electrobun.config.ts
const config: ElectrobunConfig = {
build: {
mac: {
icons: "App.icon",
},
},
};

Windows

Set the build.win.icon option in your electrobun.config file to a path to an .ico or .png file. If you provide a PNG, it will be automatically converted to ICO format during the build.

The icon is embedded into the launcher executable, the Bun runtime executable, and the installer, so it appears in the taskbar, desktop shortcuts, and File Explorer.

For best results with .ico files, include multiple sizes: 16x16, 32x32, 48x48, and 256x256. If you provide a .png it should be at least 256x256 pixels.

electrobun.config.ts
const config: ElectrobunConfig = {
build: {
win: {
icon: "assets/icon.ico",
// or use a PNG from your macOS iconset:
// icon: "icon.iconset/icon_256x256.png",
},
},
};

Linux

Set the build.linux.icon option in your electrobun.config file to a path to a .png file. The icon should be at least 256x256 pixels.

The icon is used for the window icon, taskbar, and the generated .desktop entry. On Linux, the extracted app also installs that desktop entry into the XDG applications directory so it can appear in application menus.

electrobun.config.ts
const config: ElectrobunConfig = {
build: {
linux: {
icon: "assets/icon.png",
// or use a PNG from your macOS iconset:
// icon: "icon.iconset/icon_256x256.png",
},
},
};