Only display the fontawesome icon in button

Viewed 403

I have this button with a fa icon.

<p-button><i class="fa fa-thumb-tack" [ngClass]="{'active': pinned}"></i></p-button>

Currently it looks like this enter image description here

Is there anyway that I can just display the icon and not the button (making the icon clickable basically).

2 Answers

Maybe you have to customize your p-button style, like making its background opacity as 0.

Or you can just display only the icon and bind event to it:

<i class="fa fa-thumb-tack" [ngClass]="{'active': pinned}" (click)="something()"></i>

However you have to make it by yourself, since PrimseNG doesn't support that kind of icon button.

The apparently has a yellow background set. You can try:

<p-button style='background-color: transparent; border: none'>
    <i style='color:silver' class="fa fa-thumb-tack" [ngClass]="{'active': pinned}"></i>
</p-button>

You can set the icons color to one that makes it more visible against the whitish background.

Related