How to make an icon itself behave like a button?


I have an icon heart on the nav bar inside a button element but the problem is when I click it, the whole button area gets animated.

Check out the SS.

I want that When i click on it only the heart icon gets clicked not the area around it.
Please help thanks.


Use ion-icon tag only instead of button and add a click event on the ion-icon tag

<Ion-icon (click)="tapevent()" tappable></ion-icon>


You can also add the attribute “ion-button”


Sorry guys its not working :frowning:


please help, its not accepting tap event now.


dont flood in forum, please


Create a codepen or plunker. We cannot help you with no code.