Migrating from PrimeIcons
You can switch in two steps. The first is a one-line change that keeps your templates as they are. The second, moving to the new class names, can happen whenever suits you, or not at all.
Step 1: swap the package
Replace the dependency:
npm uninstall primeicons
npm install @openvue/openiconsThen change the import:
import 'primeicons/primeicons.css';
import '@openvue/openicons/primeicons.css'; That's it. @openvue/openicons/primeicons.css loads a compatibility stylesheet that maps every pi and pi-* class onto the OpenIcons font, so markup like this keeps working:
<i class="pi pi-check"></i>New icons that didn't exist in PrimeIcons get a pi- class too, so you can use them right away without renaming anything.
Step 2: move to the oi- classes (optional)
Import the main stylesheet instead:
import '@openvue/openicons/openicons.css';Then rename the classes. pi becomes oi and every pi- prefix becomes oi-:
<i class="pi pi-check"></i>
<i class="oi oi-check"></i> A search and replace across your templates handles most of it. Two patterns cover the common cases:
| Find (regex) | Replace |
|---|---|
\bpi pi- | oi oi- |
\bpi-(?=[a-z]) | oi- |
Check the result before committing. The second pattern will also match any of your own classes that happen to start with pi-.
During a gradual migration you can load both stylesheets. The font is only downloaded once.
What's different
pi-primeis gone. It was the PrimeTek logo, which isn't covered by the MIT license. If you used it, replace it with your own asset.- The spin animation is
oi-spin. The classpi-spinstill works through the compatibility stylesheet. If your own CSS refers to thefa-spinkeyframes, a leftover from Font Awesome in PrimeIcons, rename it tooi-spin. - The font family is
openicons. This only matters if your CSS setsfont-family: 'primeicons'directly, for example in a pseudo-element. Change it to'openicons'. Codepoints are the same.
Everything else (glyphs, codepoints, sizes, pi-fw) is unchanged.
PrimeVue
PrimeVue components that use icon classes keep working with the compatibility stylesheet, because the class names they render are unchanged. If you're moving from PrimeVue to OpenVue, OpenIcons is the set it uses.