PrimeIcons is available at npm, run the following command to download it to your project.
-
+
npm install primeicons --save
Getting Started
- 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
+ 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
-
+
<i class="pi pi-check"></i>
<i class="pi pi-times"></i>
-
-
+
+
Size
Size of the icons can easily be changed using font-size property.
-
+
<i class="pi pi-check"></i>
-
+
<i class="pi pi-check" style="font-size: 2rem"></i>
@@ -44,7 +43,7 @@ npm install primeicons --save
Spinning Animation
Special pi-spin class applies continuous rotation to an icon.
-
+
<i class="pi pi-spin pi-spinner" style="font-size: 2rem"></i>
@@ -53,12 +52,12 @@ npm install primeicons --save
Constants
PrimeIcons constants API is provided to easily choose an icon with typescript e.g. when defining a menu model.
-
+
<Menu :model="items" />
-
+
import {PrimeIcons} from 'primevue/api';
export default {
@@ -90,53 +89,49 @@ export default {
- pi-{{icon.properties.name}}
+ pi-{{ icon.properties.name }}