I've managed to solve this problem by replacing background-image with content.

Css below:

.m-icon {
 content: url("../images/module.png");
}
Answer from SamuelS on Stack Overflow
🌐
PrimeReact
primereact.org › icons
React Icon Library - PrimeReact
PrimeIcons is the default icon library of PrimeReact.
Button
Button is an extension to standard input element with icons and theming.
Calendar
An additional icon is displayed next to the input field when showIcon is present.
DataTable
The ultimate collection of design-agnostic, flexible and accessible React UI Components.
Installation
PrimeReact is a rich set of open source components for React.
🌐
PrimeFaces
primefaces.org › primereact-v8 › icons
React Icon Library - PrimeReact
PrimeReact components internally use PrimeIcons library, the official icons suite from PrimeTek.
🌐
PrimeReact
primereact.org › button
PrimeReact | React UI Component Library
<Button label="Small" icon="pi pi-check" size="small" /> <Button label="Normal" icon="pi pi-check" /> <Button label="Large" icon="pi pi-check" size="large" /> Custom content inside a button is defined as children.
🌐
PrimeReact
primereact.org › customicons
Custom Icons - PrimeReact
PrimeReact components can be used with any icon library using the templating features. Icons are passed the iconProps of the original icon and the props of the component.
🌐
Streamline HQ
streamlinehq.com › icons › download › primereact--31088
Primereact icon - Free Download PNG & SVG | Streamline
Download Primereact SVG vector or transparent PNG icon in Solid, Bold, Glyph style(s) for Sketch and Figma. It belongs to Simple Icons vectors SVG collection.
🌐
GitHub
github.com › primefaces › primereact › issues › 6464
Missing icons · Issue #6464 · primefaces/primereact
April 24, 2024 - e.g. "gauge", "warehouse" and "hammer" are missing. In total, there are 311 icons, but only 261 types. ... Type: BugIssue contains a defect related to a specific component.Issue contains a defect related to a specific component.good first issue*** Welcome to PrimeReact Family!
Author   inad9300
🌐
DEV Community
dev.to › vishalbhuva666 › how-to-add-primereact-icon-in-react-app-11ph
How To Add PrimeReact Icon In React App - DEV Community
July 9, 2024 - import 'primereact/resources/themes/saga-blue/theme.css'; import 'primereact/resources/primereact.min.css'; import 'primeicons/primeicons.css';
Find elsewhere
🌐
npm
npmjs.com › package › @primereact › icons
primereact/icons
June 30, 2025 - Latest version: 11.0.0-alpha.1, last published: 9 months ago. Start using @primereact/icons in your project by running `npm i @primereact/icons`. There are 2 other projects in the npm registry using @primereact/icons.
      » npm install @primereact/icons
    
Published   Jun 30, 2025
Version   11.0.0-alpha.1
Author   PrimeTek Informatics
🌐
Primereact
v9.primereact.org › inputtext
PrimeReact | React UI Component Library
Icons can be placed inside an input element by wrapping both the input and the icon with an element that has either .p-input-icon-left or p-input-icon-right class.
Top answer
1 of 2
1

We were able to use material-icons and still have the same functionality. However, you need to create a class for each icon you will use. I think that is a little price to pay for this feature.

  1. First install material icons $ npm install material-design-icons
  2. We imported the CSS like so @import 'material-design-icons/iconfont/material-icons.css'; You can import it using the standard way with Link tag

Create a class like so

.dms-mat-icon-email::before {
  content: "email" /* This is the icon name from material */;
}

You can now use the class like so

<Button
  icon="material-icons dms-mat-icon-email"
></Button>

We are using a wrapper component to dynamically pass the icon so we don't hardcode it

import * as React from "react";
import { Button } from "primereact/button";
import { Color } from "../theme/DMSTheme";
import classNames from "classnames";

interface IDMSButtonProps {
  label?: string;
  icon?: string;
  iconPos?: string;
  color?: Color;
  type:string;
}

const DMSButton: React.FunctionComponent<IDMSButtonProps> = (props) => {
  return (
    <Button
    type = {props.type}
      className={classNames({
        "dms-clr-text" : props.color && props.color === Color.Text,
        "p-button-text p-button-rounded": !props.label,
        "p-button-secondary" : props.color && props.color === Color.Secondary,
      })}
      iconPos={props.iconPos}
      label={props.label}
      icon={props.icon ? `material-icons dms-mat-icon-${props.icon}` : ""}
    ></Button>
  );
};

export default DMSButton;

If anyone has a better idea to simplify this, please comment!

2 of 2
0

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>
🌐
PrimeFaces
primefaces.org › diamond › icons.xhtml
Icons
PrimeFaces components internally use PrimeIcons library, the official icons suite from PrimeTek.
🌐
PrimeFaces
primefaces.org › primereact-v8
PrimeReact | React UI Component Library
Icon Library200+ Icons · Get Started · npm i primereact primeicons · Components · Over 80 React UI Components with top-notch quality to help you implement all your UI requirements in style. Get Started · Balance · Category · Clothing · Fitness · Electronics ·