Add extra ICONS

Hi, How can I add more icons in JMIX?
lets say I want to add icons from https://www.flaticon.com/
is there a way that they can be set to components like

button.setIcon(NewIconSet.CAMERA.source());

No docs yet.
https://docs.jmix.io/jmix/ui/icons.html

Hello!

There is an issue to describe how to use custom Icon sets: jmix-framework/jmix-docs#380.

In Jmix custom Icon set can be added the same way like in CUBA: Icon Sets - CUBA Platform. Developer’s Manual

  1. Create enum that will contain icons:
public enum MyIcon implements Icons.Icon {

    INSTAGRAM("classpath:/myicon/instagram.png");

    private String source;

    MyIcon(String source) {
        this.source = source;
    }

    @Override
    public String source() {
        return source;
    }

    @Override
    public String iconName() {
        return name();
    }
}
  1. Add application property:
jmix.ui.icons-config=com.company.myapp.icon.MyIcon
  1. Use in the code:
iconBtn.setIconFromSet(MyIcon.INSTAGRAM);
<button id="iconBtn" icon="INSTAGRAM"/>
1 Like