How to use a custom icon in card

Has anyone figured out a way to use a custom icon on a card?


Can you give me an example of what you want to achieve?

You didn’t ask for this, but I’ve seen users do progress bars? is that helpful?

I’ll paste the code here if this is also what you have in mind.

Let me know.

I have a few static images (like below) that I converted to icons. I would like to use these custom icons on a few cards vs the font awesome.

file error

Here’s some JavaScript code you may use to do this.

            data.ele.find('.af-card-component .con').prepend('<img class="custom-icon" src="">');    

Two things to note

  1. You will need to change component_3 to the card component ID
  2. You will need to change IMAGE_SRC to the image source. For example,

Do let me know if you have any further questions about this. I’ll be more than happy to help!

This does work, however, when I leave the page and go back to it, it adds an additional image.

@mdykstra Good point! I’ve updated the code in the above post to fix that.

1 Like