In this section, we are going to discuss how to create our own icons for the PrimeFaces web application. Instead of using images, you need to use image sprites by considering the impact of application performance.
Most of the time, we might be interested in adding custom icons to UI components apart from the regular standard icon set. Generally, in order to create our own custom icons, we need to provide CSS classes with the
background-image property, which is referred to the image in the theme
For example, the following
commandButton components will use a custom icon:
<p:commandButton value="With Icon" icon="disk"/> <p:commandButton icon="disk"/>
disk icon is created by adding the
.disk CSS class ...