Button icon with Material icon

UI Components for React
Post Reply
bigzidane
Posts: 58
Joined: 21 Jan 2015, 22:16

11 Jan 2021, 16:51

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.

mert.sincan
Posts: 4637
Joined: 29 Jun 2013, 12:38

26 Jan 2021, 11:58

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,

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest