Icons are used widely by IntelliJ Platform plugins. Plugins need icons mostly for actions, custom component renderers, Tool Windows, etc.
A Plugin Logo, which represents the plugin itself, has different requirements than icons used within plugins.
Platform vs. Custom IconsPlugins should reuse existing platform icons whenever possible.
Use the Icons list to browse existing icons. Platform icons are located in AllIcons
. Icons from plugins are located in the corresponding <PLUGIN_NAME>Icons
class (e.g., GithubIcons
).
If custom icons are required, refer to detailed design guide.
Organizing IconsSee Action Basics sample plugin as a reference.
In the case of a Gradle-based project, icons should be placed in the resources directory. If the project is DevKit-based, the recommended approach is to put icons to a dedicated source root marked as Resources Root, e.g., icons or resources.
If the icons are referenced only in plugin.xml or via @Presentation
icon
attribute, then they can be referenced by paths. In case the icons are referenced from the code and/or XML many times, it's convenient to organize them in an icon holder class.
Starting with 2021.2, the *Icons
class is not required to be located in the icons
package but can use the plugin's package:
icons.MyIcons
â com.example.plugin.MyIcons
.
Define a class/interface in a top-level package called icons
holding icon constants as static fields:
package icons; public interface MyIcons { Icon Action = IconLoader.getIcon("/icons/action.svg", MyIcons.class); Icon ToolWindow = IconLoader.getIcon("/icons/toolWindow.svg", MyIcons.class); }
When using Kotlin, fields must be annotated with @JvmField
:
package icons object MyIcons { @JvmField val Action = IconLoader.getIcon("/icons/action.svg", javaClass) @JvmField val ToolWindow = IconLoader.getIcon("/icons/toolWindow.svg", javaClass) }
The getIcon()
method of IconLoader
can be used to access the icons. The path to the icon passed in as argument to IconLoader.getIcon()
must start with leading /
.
Icons defined inside plugin.xml with icon
attribute for <action>
or extension point, as well as in @Presentation
icon
attribute, can be referenced in two ways.
To reference an icon by path, provide the path relative to the resources directory, e.g., for icons located in my-plugin/src/main/resources/icons directory:
<actions> <action icon="/icons/myAction.svg" ... /> </actions> <extensions defaultExtensionNs="com.intellij"> <toolWindow icon="/icons/myToolWindow.svg" ... /> </extensions>
By Icons ClassIn the case of icon holder class, reference the icon constants. Note that if the class is located in the top-level icons
package, the icons
package name will be automatically prefixed and must not be specified. In case of placing the class in a custom package, the full package name must be provided, e.g.:
<actions> <!-- referencing icons from 'MyIcons' class in top-level 'icons' package --> <action icon="MyIcons.MyAction" ... /> </actions> <extensions defaultExtensionNs="com.intellij"> <!-- referencing icons from 'MyIcons' in custom package --> <toolWindow icon="com.example.plugin.MyIcons.MyToolWindow" ... /> </extensions>
Icon FilesThe IntelliJ Platform supports HiDPI displays and comes with a bundled dark theme. Thus, every icon should have a dedicated variant for dark theme and optionally for HiDPI. If the original icon works well enough in dark theme, a dark variant is not required.
The platform will load the best matching icon variant (if available) depending on the current environment.
Icon SizesRequired icon sizes depend on the usage as listed in the following table:
Usage
Icon Size
Node, Action, Filetype
16Ã16
Tool window
13Ã13
Tool window for New UI
20Ã20 and 16Ã16 (see New UI Tool Window Icons)
Editor gutter
12Ã12
Editor gutter for New UI
14Ã14
As SVG icons can be scaled arbitrarily, they provide good results in HiDPI environments or when used in combination with bigger screen fonts (e.g., in Presentation Mode).
A base size denoting the size (in the user space) of the rendered image in 1x scale should be provided. The size is set via the width
and height
attributes omitting the size units. If unspecified, it defaults to 16Ã16 pixels.
A minimal SVG icon file:
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"> <rect width="100%" height="100%" fill="green"/> </svg>
HiDPI VersionThe icon graphics of such an icon can be expressed in more details via double precision. If the icon graphics are simple enough so that it renders perfectly in every scale, then the HiDPI version can be omitted. The HiDPI version should still provide the same base size.
FilenamesAll icon files must be placed in the same directory following this naming pattern:
Theme/Resolution
Filename
Icon Size
Light
iconName.svg
WÃH
Dark
iconName_dark.svg
WÃH
Light + HiDPI
iconName@2x.svg
2ÃW Ã 2ÃH
Dark + HiDPI
iconName@2x_dark.svg
2ÃW Ã 2ÃH
New UI IconsSee UI Kit for guidelines and overview.
To fully support the New UI, the plugin must provide additional dedicated icons and mapping information. This allows supporting both UI variants at the same time, depending on what the user has selected.
SetupCreate a new expui directory in the icon root directory (Reference).
Copy all icons for the New UI into this directory.
Create an empty $PluginName$IconMappings.json mapping file in the resources directory.
Register $PluginName$IconMappings.json in plugin.xml via the com.intellij.iconMapper
extension point.
Sample setup from Maven plugin:
Icon resources root directory: images
Mapping file: MavenIconMappings.json
Extension point registration (<iconMapper mappingFile="MavenIconMappings.json"/>
): plugin.xml
All New UI icons must be mapped in the $PluginName$IconMappings.json mapping file.
For each New UI icon, add a mapping entry inside expui
block. Each directory starts a new block containing all its entries (see linked MavenIconMappings.json
sample from above).
In this example, the icon root directory is named icons:
{ "icons": { "expui": { "dirName": { "icon1.svg": "icons/icon1.svg", "icon2.svg": "icons/icon2.svg" }, "anotherDir": { "anotherIcon.svg": "images/anotherIcon.svg" } } } }
If one new icon replaces several old icons, use a JSON list. Example from PlatformIconMappings.json
:
"vcs.svg": [ "toolwindows/toolWindowChanges.svg", "vcs/branch.svg" ]
New UI Tool Window IconsThe New UI uses outlined icons for tool windows that have a size of 20Ã20 pixels and 16Ã16 pixels in Compact Mode. To provide all necessary variants of a tool window icon use the following filename scheme:
Theme/Mode
Filename
Icon Size
Light
toolWindowIcon@20x20.svg
20Ã20
Dark
toolWindowIcon@20x20_dark.svg
20Ã20
Light + Compact Mode
toolWindowIcon.svg
16Ã16
Dark + Compact Mode
toolWindowIcon_dark.svg
16Ã16
New UI Icon ColorsTo work as expected, the New UI requires specific colors for icon content. This is necessary for situations where tool window buttons are active, during which the background is highlighted. To enhance contrast, the IntelliJ Platform dynamically alters the icon's content color to white.
Hence, for the creation of light and dark mode variants, plugin authors must use the following prescribed colors within their icons:
Theme
Color Code
Light
#6C707E
â
Dark
#CED0D6
â
Various online resources, like the UI Guidelines here and here, will be updated soon and currently don't include information about the New UI.
Animated IconsAnimated icons are a way to show that a plugin is now performing some long-time action, e.g., when the plugin is loading some data.
Any animated icon is a set of frames that loop with a delay.
To create a new animated icon, use the AnimatedIcon
. To create an icon where frames follow each other with the same delay, use a constructor that accepts a delay and icons:
AnimatedIcon icon = new AnimatedIcon( 500, AllIcons.Ide.Macro.Recording_1, AllIcons.Ide.Macro.Recording_2);
To create an icon from frames with different delays, use AnimatedIcon.Frame
. Each frame represents an icon, and a delay until the next frame.
Set AnimatedIcon.ANIMATION_IN_RENDERER_ALLOWED
client property to true
for list, table, and tree components to repaint animated icons automatically. See its Javadoc for details.
Use the predefined AnimatedIcon.Default
loader icon to indicate a long process. This icon has a larger AnimatedIcon.Big
version.
Alternatively, use AsyncProcessIcon
.
Register a resource bundle via com.intellij.iconDescriptionBundle
extension point to provide tooltips automatically for all SimpleColoredComponent
renderers.
Create icon.<icon-path>.tooltip
key in the resource bundle, where <icon-path>
is the icon path with leading slash and .svg
removed and slashes replaced with dots:
/nodes/class.svg â icon.nodes.class.tooltip
08 May 2025
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4