Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Currently I'm using Button from PrimeReact. 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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
394 views
Welcome To Ask or Share your Answers For Others

1 Answer

Yes, you can. But you will not be able to use it like you are using it currently. You can also use fontawesome icons. This is probably the best way yo use it.

<Button
    label="Hello"
    style={{
      display: "flex",
      justifyContent: "center",
      alignItems: "center",
      width: '100%'
    }}
    className="p-button-info" 
    tooltip='View/Edit Job'
    onClick={(e) => gotoJob(e, job.id)}
  >
    <AccountCircleIcon />
  </Button>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...