Skip to main content
Dec 14, 2020 8:04 AM UTC

Display an Icon on a form button

What is the recommended way to display an Icon on a button in an Adaptive From instead of the usual text?

I've checked the button component's  widget.jsp and while there is a <span class="iconButton-icon"></span> being rendered, I don't see anything that appears to allow specifying an icon to display. Ideally I'd like to use the built-in icons already provided by aem.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

6 replies

MHWinter
Level 4
Dec 15, 2020 9:59 PM UTC

I am not an expert so this may not be the most elegant way of doing it: a simple solution is just to place an image object over the button object. I tried and it works 🙂

Translate
Dec 22, 2020 12:54 PM UTC
How did you place the image over the button?
Translate
Mayank_Gandhi
Adobe Employee
Adobe Employee
Dec 17, 2020 3:17 PM UTC

@william_van_deventer  You can use the image component or text component and embed the image using source edit.

Translate
Dec 22, 2020 12:47 PM UTC

How does this work with a button?

Translate
Mayank_Gandhi
Adobe Employee
Adobe Employee
Dec 22, 2020 1:39 PM UTC

@william_van_deventer Have you tried the style editor to add inline css?

Translate
Level 9
Jun 4, 2024 3:57 AM UTC

Late, but anyone trying to find an option , try overriding button.scss and add before annotations to place an icon say remix icon and use style system to choose and set for buttons. 

Translate