'use client'; import React, { useEffect, useState } from 'react'; import Link from 'next/link'; import { IconService } from '../../../../demo/service/IconService'; import { InputText } from 'primereact/inputtext'; const IconsDemo = () => { const [icons, setIcons] = useState([]); const [filteredIcons, setFilteredIcons] = useState([]); useEffect(() => { IconService.getIcons().then((data) => { data.sort((icon1, icon2) => { if (icon1.properties.name < icon2.properties.name) return -1; else if (icon1.properties.name < icon2.properties.name) return 1; else return 0; }); setIcons(data); setFilteredIcons(data); }); }, []); const onFilter = (event) => { if (!event.target.value) { setFilteredIcons(icons); } else { setFilteredIcons( icons.filter((it) => { return it.icon.tags[0].includes(event.target.value); }) ); } }; return (
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 --save`}
PrimeIcons use the pi pi-{icon} syntax such as pi pi-check. A standalone icon can be displayed using an element like i or span
{``}
Size of the icons can easily be changed using font-size property.
{``}
{``}
Special pi-spin class applies continuous rotation to an icon.
{``}
Here is the current list of PrimeIcons, more icons are added periodically. You may also{' '} request new icons {' '} at the issue tracker.