Page 1 of 1

Button icon with Material icon

Posted: 11 Jan 2021, 16:51
by bigzidane
Currently I'm using Button from Primefaces React. They are using icon from PrimeIcons but the number of icon are limited and I'd like to use Material Icons with it.

<Button label='View/Edit Job' icon="pi pi-pencil" className="p-button-info"
tooltip='View/Edit Job'
onClick={(e) => gotoJob(e, job.id)} style={{ width: '100%' }} />

If that is possible, please advice me.

Re: Button icon with Material icon

Posted: 26 Jan 2021, 11:58
by mert.sincan
Hi,

You can use custom content option. Exp;

Code: Select all

<Button className="p-button-info" tooltip='View/Edit Job' onClick={(e) => gotoJob(e, job.id)} style={{ width: '100%' }}>
   <i class="material-icons">face</i>
   <span className="p-button-label p-c">View/Edit Job</span>
</Button>
I made some improvements in the next version. The above code will work better in the next version.

Best Regards,