PrimeReact components internally use PrimeIcons library, the official icons suite from PrimeTek.
PrimeIcons is available at npm, run the following command to download it to your project.
npm install primeicons
Then import the library.
import 'primeicons/primeicons.css';
PrimeIcons use the pi pi-{icon} syntax such as pi pi-check. A standalone icon can be displayed using an element such as i or span
<i className="pi pi-check mr-2"></i>
<i className="pi pi-times"></i>
Size of the icons can easily be changed using font-size property.
<i className="pi pi-check"></i>
<i className="pi pi-check" style={{'fontSize': '2em'}}></i>
Special pi-spin class applies infinite rotate to an icon.
<i className="pi pi-spin pi-spinner" style={{'fontSize': '2em'}}></i>
PrimeIcons constants API is provided to easily choose an icon e.g. when defining a menu model.
import { PrimeIcons } from 'primereact/api';
import { Menu } from 'primereact/menu';
const MenuDemo = () => {
const items = [
{
label: 'File',
items: [
{label: 'New', icon: PrimeIcons.PLUS},
{label: 'Open', icon: PrimeIcons.DOWNLOAD}
]
},
{
label: 'Edit',
items: [
{label: 'Undo', icon: PrimeIcons.REFRESH},
{label: 'Redo', icon: PrimeIcons.REPEAT}
]
}
];
return <Menu model={items} />
}
Here is the current list of PrimeIcons, more icons will be added periodically. You may also request new icons at the issue tracker.
Built-in component themes created by the PrimeReact Theme Designer.
Premium themes are only available exclusively for PrimeReact Theme Designer subscribers and therefore not included in PrimeReact core.
Beautifully crafted premium create-react-app application templates by the PrimeTek design team.