Migration guide
Migrating from PrimeNG to Styloviz
From a PrimeNG 21 application to one that builds on Styloviz, one screen at a time. Both libraries run side by side while you move, so the application keeps working throughout. Every Styloviz example on this page is a complete component that is compiled with strict templates on every build of this site, and the whole guide was followed on a fresh Angular 21 + PrimeNG 21 application through to a production build with PrimeNG removed.
Before you start, check what Styloviz does not have against your application. If you use one of those components, plan for it first.
Upgrading an application that already uses Styloviz 1.x? See Migrating to Styloviz 2.0.
1. Install alongside PrimeNG
Add the free tier and the stylesheet. Nothing in your PrimeNG setup changes yet: the selectors do not collide, so a screen can use both while you move it.
Install
npm i @styloviz/all Styloviz components are Tailwind CSS 4 utilities. If the application does not use Tailwind yet, add it and its PostCSS plugin; the Angular CLI picks up .postcssrc.json from the project root.
Tailwind CSS (skip if you already use it)
npm i -D tailwindcss @tailwindcss/postcss postcss
PostCSS config
{
"plugins": {
"@tailwindcss/postcss": {}
}
}Global stylesheet
/* src/styles.css */ @import "tailwindcss"; @import "@styloviz/core/styles/styloviz.css"; @source "../node_modules/@styloviz";
If the application does not use Tailwind yet, Tailwind's base styles (preflight) reset margins, headings and lists across the page, which can change how existing PrimeNG screens look. Check a few screens after this step.
The @source line scans every installed Styloviz package, so with the whole kit installed the stylesheet carries rules for components you do not use yet. Once the first screens import their Styloviz components, run the command below: it replaces that line with one per kit file your imports reach. Run it again as you move more screens over, or see Stylesheet size and budgets.
Narrow the stylesheet to what you import
ng g @styloviz/core:sources2. Move the theme
PrimeNG themes are presets passed to providePrimeNG. Styloviz components are Tailwind utilities over theme tokens, so a brand colour is a CSS variable. Set your primary scale once and every component follows it, in light and dark mode. The Theme Builder builds the token block, previews it in both modes and checks its contrast.
PrimeNG
// app.config.ts import Aura from '@primeuix/themes/aura'; import { providePrimeNG } from 'primeng/config'; providePrimeNG({ theme: { preset: Aura, options: { darkModeSelector: '.app-dark' } }, });
Styloviz
/* src/styles.css, after the Styloviz import. Brand colours are Tailwind theme tokens; every component reads them. */ @theme { --color-primary-500: #14b8a6; --color-primary-600: #0d9488; --color-primary-700: #0f766e; } /* Dark mode is class="dark" on <html>, toggled by ThemeService from @styloviz/core. */
3. Component by component
Move one screen at a time: replace its PrimeNG elements using the table, swap the imports in that component, and ship it. Each Styloviz name links to its documentation. PrimeNG selectors are checked against primeng@21.1.10.
| PrimeNG | Styloviz | Import from |
|---|---|---|
| p-table | sv-data-table | @styloviz/data-table |
| p-dataview | sv-list-view | @styloviz/list-view |
| p-paginator | sv-pagination | @styloviz/pagination |
| p-tree | sv-tree-view | @styloviz/tree-view |
| p-timeline | sv-timeline | @styloviz/timeline |
| p-picklist | sv-transferPro | @styloviz-pro/display |
| p-orderlist | sv-dnd-list | @styloviz/display |
| p-chart | sv-line-chart | @styloviz/charts |
| PrimeNG | Styloviz | Import from |
|---|---|---|
| p-button | sv-button | @styloviz/button |
| p-splitbutton | sv-split-buttonPro | @styloviz-pro/split-button |
| [pInputText] | sv-input-field | @styloviz/input-field |
| p-inputnumber | sv-number-input | @styloviz/forms |
| p-inputmask | sv-input-mask | @styloviz/forms |
| p-inputotp | sv-otp-input | @styloviz/forms |
| p-password | sv-password-strength | @styloviz/password-strength |
| p-select | sv-select-dropdown | @styloviz/select-dropdown |
| p-multiselect | sv-select-dropdown | @styloviz/select-dropdown |
| p-autocomplete | sv-autocomplete | @styloviz/forms |
| p-datepicker | sv-date-picker | @styloviz/input-field |
| p-checkbox | sv-checkbox | @styloviz/forms |
| p-radiobutton | sv-radio-group | @styloviz/forms |
| p-toggleswitch | sv-toggle-switch | @styloviz/toggle-switch |
| p-slider | sv-slider | @styloviz/forms |
| p-rating | sv-rating | @styloviz/forms |
| p-colorpicker | sv-color-picker | @styloviz/forms |
| p-selectbutton | sv-segmented-control | @styloviz/forms |
| p-chip | sv-chip | @styloviz/forms |
| p-fileupload | sv-file-upload | @styloviz/file-upload |
| p-editor | sv-rich-text-editorPro | @styloviz-pro/rich-editor |
| p-treeselect | sv-tree-selectPro | @styloviz-pro/forms |
| p-cascadeselect | sv-cascaderPro | @styloviz-pro/forms |
| p-inplace | sv-inplace-edit | @styloviz/forms |
| PrimeNG | Styloviz | Import from |
|---|---|---|
| p-dialog | sv-modal | @styloviz/modal |
| p-confirmdialog | sv-confirm-dialogPro | @styloviz-pro/overlays |
| p-drawer | sv-drawerPro | @styloviz-pro/overlays |
| p-popover | sv-popoverPro | @styloviz-pro/overlays |
| [pTooltip] | sv-tooltip | @styloviz/overlays |
| p-toast | sv-toast-host | @styloviz/toast |
| p-message | sv-alert-banner | @styloviz/alert-banner |
| p-skeleton | sv-skeleton-loader | @styloviz/skeleton-loader |
| p-progressbar | sv-progress-bar | @styloviz/overlays |
| p-progressspinner | sv-spinner | @styloviz/overlays |
| PrimeNG | Styloviz | Import from |
|---|---|---|
| p-menu | sv-dropdown-menuPro | @styloviz-pro/overlays |
| p-contextmenu | sv-dropdown-menuPro | @styloviz-pro/overlays |
| p-menubar | sv-menubarPro | @styloviz-pro/overlays |
| p-megamenu | sv-mega-menuPro | @styloviz-pro/mega-menu |
| p-panelmenu | sv-sidebar-nav | @styloviz/sidebar-nav |
| p-breadcrumb | sv-breadcrumb | @styloviz/breadcrumb |
| p-stepper | sv-stepper | @styloviz/stepper |
| p-tabs | sv-tabs | @styloviz/tabs |
| p-accordion | sv-accordion | @styloviz/accordion |
| p-speeddial | sv-speed-dialPro | @styloviz-pro/layout |
| p-dock | sv-dock | @styloviz/layout |
| PrimeNG | Styloviz | Import from |
|---|---|---|
| p-avatar | sv-avatar | @styloviz/avatar |
| p-badge | sv-badge | @styloviz/badge |
| p-carousel | sv-carousel | @styloviz/display |
| p-galleria | sv-image-gallery | @styloviz/display |
| p-imagecompare | sv-image-compare | @styloviz/image-compare |
| p-splitter | sv-splitterPro | @styloviz-pro/layout |
| p-toolbar | sv-toolbar | @styloviz/layout |
| p-divider | sv-divider | @styloviz/layout |
| p-scrollpanel | sv-scroll-area | @styloviz/scroll-area |
| p-scrolltop | sv-scroll-to-top | @styloviz/layout |
4. Data table
Usually the biggest single job, so do it first on the screen you know best.
PrimeNG
<p-table [value]="orders" dataKey="id" [paginator]="true" [rows]="10" selectionMode="multiple" [(selection)]="selected"> <ng-template #header> <tr> <th pSortableColumn="id">Order <p-sortIcon field="id" /></th> <th pSortableColumn="customer">Customer <p-sortIcon field="customer" /></th> <th>Status</th> <th pSortableColumn="total">Total <p-sortIcon field="total" /></th> </tr> </ng-template> <ng-template #body let-order> <tr [pSelectableRow]="order"> <td>{{ order.id }}</td> <td>{{ order.customer }}</td> <td>{{ order.status }}</td> <td>{{ order.total }}</td> </tr> </ng-template> </p-table>
Styloviz
// ─── orders-table.component.ts ─────────────────────────────────────────────── import { Component } from '@angular/core'; import { SvDataTableComponent } from '@styloviz/data-table'; import type { TableColumn, TableRowAction } from '@styloviz/data-table'; interface Order extends Record<string, unknown> { id: string; customer: string; status: string; total: number; } @Component({ selector: 'app-orders-table', standalone: true, imports: [SvDataTableComponent], templateUrl: './orders-table.component.html', }) export class OrdersTableComponent { // p-table's header and body templates become one typed column list. readonly columns: TableColumn<Order>[] = [ { key: 'id', label: 'Order', sortable: true }, { key: 'customer', label: 'Customer', sortable: true }, { key: 'status', label: 'Status' }, { key: 'total', label: 'Total', sortable: true }, ]; readonly orders: Order[] = [ { id: 'SO-1042', customer: 'Northwind Traders', status: 'Paid', total: 1240 }, { id: 'SO-1043', customer: 'Acme Logistics', status: 'Open', total: 560 }, { id: 'SO-1044', customer: 'Blue Harbour Ltd', status: 'Overdue', total: 980 }, ]; readonly actions: TableRowAction<Order>[] = [ { label: 'Open', icon: 'eye', handler: (row) => console.log('open', row.id) }, ]; } // ─── orders-table.component.html ──────────────────────────────────────────── <sv-data-table tableTitle="Orders" [columns]="columns" [rows]="orders" [actions]="actions" [selectable]="true" [paginated]="true" [pageSize]="10" [showToolbar]="true" [searchable]="true" />
- The header and body templates become a typed column list; sortable is a flag per column.
- Paging, search and selection are inputs. For data the server pages, set [serverSide] and handle (queryChange): see Connecting to a backend.
- Rows need an id (rowKey, "id" by default), the equivalent of dataKey.
5. Forms
Your FormGroup and validators do not change. Only the controls in the template do.
PrimeNG
<form [formGroup]="form" (ngSubmit)="save()"> <label for="name">Name</label> <input pInputText id="name" formControlName="name" /> <p-select formControlName="plan" [options]="plans" optionLabel="label" optionValue="value" /> <p-datepicker formControlName="startDate" /> <p-checkbox formControlName="newsletter" [binary]="true" inputId="news" /> <label for="news">Send me product updates</label> <p-button type="submit" label="Save" /> </form>
Styloviz
// ─── customer-form.component.ts ────────────────────────────────────────────── import { Component, inject } from '@angular/core'; import { FormBuilder, ReactiveFormsModule, Validators } from '@angular/forms'; import { SvButtonComponent } from '@styloviz/button'; import { SvCheckboxComponent } from '@styloviz/forms/checkbox'; import { SvDatePickerComponent, SvInputFieldComponent } from '@styloviz/input-field'; import { SvSelectDropdownComponent, type SelectOption } from '@styloviz/select-dropdown'; @Component({ selector: 'app-customer-form', standalone: true, imports: [ ReactiveFormsModule, SvInputFieldComponent, SvSelectDropdownComponent, SvDatePickerComponent, SvCheckboxComponent, SvButtonComponent, ], templateUrl: './customer-form.component.html', }) export class CustomerFormComponent { private readonly fb = inject(FormBuilder); // The FormGroup does not change: formControlName works on every control. readonly form = this.fb.nonNullable.group({ name: ['', Validators.required], plan: ['team'], startDate: [''], newsletter: [false], }); readonly plans: SelectOption[] = [ { value: 'personal', label: 'Personal' }, { value: 'team', label: 'Team' }, { value: 'enterprise', label: 'Enterprise' }, ]; save(): void { if (this.form.valid) console.log(this.form.getRawValue()); } } // ─── customer-form.component.html ──────────────────────────────────────────── <form class="space-y-4" [formGroup]="form" (ngSubmit)="save()"> <sv-input-field label="Name" formControlName="name" [required]="true" /> <sv-select-dropdown label="Plan" formControlName="plan" [options]="plans" /> <sv-date-picker label="Start date" formControlName="startDate" /> <sv-checkbox label="Send me product updates" formControlName="newsletter" /> <sv-button type="submit" variant="primary" label="Save" /> </form>
- Every Styloviz form control is a ControlValueAccessor: formControlName and ngModel work unchanged.
- Labels, hints and error text are inputs on the control, not separate elements.
- p-select options become { value, label } objects, so optionLabel and optionValue go away.
6. Dialogs, toasts and other overlays
The behaviour you get from appendTo="body" is the default here, for every overlay.
PrimeNG
<p-button label="Delete order" severity="danger" (onClick)="open = true" /> <p-dialog header="Delete order?" [(visible)]="open" [modal]="true" appendTo="body"> <p>This cannot be undone.</p> <ng-template #footer> <p-button label="Cancel" severity="secondary" (onClick)="open = false" /> <p-button label="Delete" severity="danger" (onClick)="confirm()" /> </ng-template> </p-dialog> <p-toast /> // confirm(): this.messageService.add({ severity: 'success', summary: 'Order deleted' });
Styloviz
// ─── delete-order.component.ts ─────────────────────────────────────────────── import { Component, inject, signal } from '@angular/core'; import { ToastService } from '@styloviz/core/services'; import { SvButtonComponent } from '@styloviz/button'; import { SvModalComponent } from '@styloviz/modal'; import { SvToastHostComponent } from '@styloviz/toast'; @Component({ selector: 'app-delete-order', standalone: true, imports: [SvButtonComponent, SvModalComponent, SvToastHostComponent], templateUrl: './delete-order.component.html', }) export class DeleteOrderComponent { // MessageService.add({ severity, summary }) becomes one method per severity. private readonly toast = inject(ToastService); readonly open = signal(false); confirm(): void { this.open.set(false); this.toast.success('Order deleted'); } } // ─── delete-order.component.html ───────────────────────────────────────────── <sv-button label="Delete order" variant="danger" (clicked)="open.set(true)" /> <!-- [(visible)] becomes [(isOpen)]. No appendTo: it always renders on <body>. --> <sv-modal [(isOpen)]="open" title="Delete order?" size="sm"> <ng-container slot="body"> <p class="text-sm text-gray-600 dark:text-gray-300">This cannot be undone.</p> </ng-container> <ng-container slot="footer"> <sv-button label="Cancel" variant="secondary" btnStyle="soft" (clicked)="open.set(false)" /> <sv-button label="Delete" variant="danger" (clicked)="confirm()" /> </ng-container> </sv-modal> <!-- Once, in your root component, like <p-toast />. --> <sv-toast-host />
- Modals, dropdowns, menus, popovers and tooltips render on <body>, so an overflow: hidden parent never clips them. There is no appendTo to set.
- [(visible)] becomes [(isOpen)]; header becomes title; the body and footer are slots.
- MessageService.add({ severity }) becomes ToastService.success(), error(), warning() or info(); <p-toast /> becomes one <sv-toast-host /> in the root component.
- ConfirmationService and p-confirmdialog map to sv-confirm-dialog, which is in Pro.
7. Remove PrimeNG
When no template references a p- element or pTooltip-style directive, remove providePrimeNG from your app config and uninstall the packages. A search for from 'primeng across src/ should return nothing first. Icons move from PrimeIcons classes to sv-icon.
Uninstall
npm uninstall primeng @primeuix/themes primeicons Then run ng build. With strict templates on, any element you missed fails the build with the file and line, rather than rendering as an empty tag.
Start with one screen
The free tier needs no license, account or key. Compare costs before you commit to the rest.