Liferay UI Icons
The Liferay UI taglibs provide several icons you can include in your apps. To add an icon to your app, use the liferay-ui:icon
tag and specify the icon with either the icon
, iconCssClass
, or image
attribute. An example of each use case is shown below.
The image
attribute specifies Liferay UI icons to use (as defined in the Unstyled theme’s images/common
folder). Here’s an example configuration for a JSP:
The Liferay UI taglib also exposes language flag icons. To use a language flag icon, provide the ../language/
relative path before the icon’s name. Below is an example snippet from the Web Content Search portlet that displays the current language’s flag along with a localized message:
You can achieve the same result in FreeMarker with the following code that uses the available init.ftl
variables and Liferay DXP macros:
The full list of available icons is shown in the figures below:
The icon
attribute specifies Font Awesome icons to use:
The iconCssClass
attribute specifies a glyphicon to use:
The examples above use some of the icon’s available attributes. See the Icon taglibdocs for the full list.