@vigdx/ui v2.2.0 on npm (opens in a new tab)

Migrating from PrimeNG

What gets simpler when you move from PrimeNG to @vigdx/ui : typed options and dialogs, native Signal Forms, no z-index setup and no theme injection. With a component mapping, theme and forms recipes, and a way to run both libraries side by side while you move one screen at a time.

View as Markdown

Before you start

PrimeNG 22.x is distributed under the PrimeUI license, which has a free Community tier for eligible organizations and a paid Commercial tier; both require a license key (PrimeNG 22's configuration has a license field). Community releases of PrimeNG 21 and earlier are MIT-licensed; their -lts releases are commercial. Check the terms that apply to you on PrimeNG's website. @vigdx/ui is MIT-licensed. This guide covers the technical side of a migration only.

The libraries differ in scope: vigdx is a smaller kit built on native platform features (the <dialog> element, signal inputs, Signal Forms) and styled with Tailwind CSS v4 tokens instead of a preset engine. Set up the kit first as described in Getting started.

What gets simpler

vigdx is not a one-to-one copy of PrimeNG. These are the places where code gets shorter or a class of bugs goes away, each with where to check it:

  • Typed options. PrimeNG's optionLabel and optionValue are string inputs naming a property. vigdx selects take SelectOption<T> objects built by a function you write, so a renamed property is a compile error rather than a blank option, and the value type T flows into the form model.
  • Typed dialogs, end to end. PrimeNG's DynamicDialogRef.close() accepts any. In vigdx the opened component declares a public readonly dialogRef = injectDialogRef<Result, Data>() (a private or protected field is invisible to the type system), and Dialogs.open() infers both from it: data is checked, and await ref.closed has the result type, without generics at the call site.
  • Signal Forms work natively. Form controls implement FormValueControl, so [formField] binds value, validation and touched state with no adapter; Reactive Forms remain one import away (VigValueAccessor).
  • No license key.@vigdx/ui is MIT-licensed and contains no license check, key or registration step, in every version.
  • No z-index configuration. PrimeNG layers overlays with z-index values (autoZIndex / baseZIndex on its dialog, a global zIndex option). vigdx dialogs and drawers open in the browser's top layer, which stacks by opening order, so there is nothing to configure.
  • No runtime theme injection. PrimeNG's styled mode inserts its theme as <style> elements at runtime and offers a csp.nonce option for that. vigdx components carry no stylesheets: their look is Tailwind utilities compiled at build time plus the static theme.css, so the kit adds no <style> element for a Content Security Policy to allow. (The Angular CDK overlay behind select-type panels loads a small structural stylesheet of its own through Angular, which Angular's CSP_NONCE covers, and with server-side rendering [style.…] bindings become style attributes, which a style-src without 'unsafe-inline' blocks.)
  • Component test harnesses. PrimeNG does not document Angular CDK component harnesses for its components. @vigdx/ui/testing has harnesses for the form controls, overlays, menus, tables and trees, built on hooks the API report records (see Testing).
  • SSR-safe ids. Label and ARIA ids are counted per application and handed from the server to the browser, so hydration never sees mismatched or duplicate ids (see Element ids).

Left out on purpose

  • Pass-through (pt) and unstyled mode. Addressing a component's internal elements through its DOM structure couples your code to it. vigdx offers layers instead: tokens (CSS custom properties you override globally, per subtree or per instance), then a documented, versioned data-part attribute on each meaningful internal element for plain CSS, plus slots for your own markup (see Customizing).
  • Draggable, resizable and maximizable dialogs. A modal dialog is a short, focused task. Dragging needs a single-pointer alternative under WCAG 2.2 (2.5.7 Dragging Movements). Use the size presets, a vig-drawer for side panels, or a routed page for long work.
  • Ripple. Pressed and hovered states come from the -hover and -active color tokens, with no script per click and nothing to turn off for users who prefer reduced motion.
  • Dialog style options (width, contentStyle, baseZIndex, appendTo). Width is a preset from the --container-dialog-* tokens, the content is your component, and the top layer makes the rest unnecessary.
Before: pass-through
<p-button label="Save" [pt]="{ root: { class: 'rounded-full' }, label: { class: 'tracking-wide' } }" />
After: tokens
<!-- One instance, or a whole subtree: tokens are plain custom properties -->
<vig-button label="Save" style="--radius-button: 9999px" />
<section style="--color-primary: var(--color-accent)">…</section>

Component mapping

Every vigdx name below is checked against the library's API in the docs build. Components marked planned are not in vigdx yet; keep the PrimeNG component for those screens.

PrimeNGvigdxImport
p-buttonvig-buttonvigButtonIconButtonButtonIcon
Differences: severity becomes variant; outlined and text become appearance; onClick is the native click; icons go in a vigButtonIcon element; loading, rounded and size (sm, lg …) stay.
pInputTextp-floatlabelp-iconfieldvig-inputvigInputPrefixvigInputSuffixInputFieldInputPrefixInputSuffix
Differences: The label is built in (label, labelPosition float or top); icons and addons go in the prefix and suffix slots.
pTextareavig-inputInputField
Differences: multiline with rows; autoResize grows with the text.
p-selectvig-selectSelect
Differences: options are SelectOption<T> objects ({ value, label }) instead of optionLabel / optionValue strings; showClear becomes clearable; item templates use vigSelectOption.
p-multiselectvig-multi-selectMultiSelect
Differences: Same options shape as vig-select; display="chip", maxSelectedLabels and selectedItemsLabel keep their names; showToggleAll becomes showSelectAll.
p-treevig-treeTreeTreeNodeTemplate
Differences: TreeNode<T> is typed and keyed: selection and expandedKeys are arrays of keys in every mode (no node objects or key maps); selectionMode="checkbox" keeps its name; filter becomes filterQuery; onNodeExpand becomes loadChildren(node, signal) returning a promise; virtualScroll becomes virtual.
p-treeselectvig-tree-selectTreeSelect
Differences: The value is an array of node keys in every mode; display="chip" keeps its name; metaKeySelection is gone (clicks toggle in multiple mode); no appendTo: the panel uses the CDK overlay.
p-cascadeselectvig-cascade-selectvigCascadeSelectOptionCascadeSelectCascadeSelectOptionTemplate
Differences: optionLabel, optionValue, optionGroupChildren and optionDisabled (string paths) become functions of the same names (optionGroupChildren as optionChildren); optionGroupLabel goes (one label function for every level); only options without children are chosen unless selectableGroups; children load lazily through loadChildren(option, signal) instead of an onGroupChange handler; breakpoint goes: below 640px the panel drills down one level at a time with a Back button; showClear becomes clearable; display="path" shows the whole path; no appendTo: the levels use the CDK overlay.
p-listboxvig-listboxListbox
Differences: ListboxOption<T> objects ({ value, label, group }) instead of optionLabel / optionValue strings; the value is always an array (at most one value without multiple); checkbox and filter keep their names; option groups come from group on each option; virtualScroll switches on by itself from 500 options; item templates use vigSelectOption.
p-orderlistvig-order-listvigListItemOrderListListItemTemplate
Differences: value is a two-way model of your own items with an itemLabel function; header becomes heading; selection keeps its name; onReorder becomes reordered; dragdrop becomes dragDrop; moves are also on Alt+arrow keys and announced; item templates use vigListItem.
p-picklistvig-pick-listvigListItemPickListListItemTemplate
Differences: source and target are two-way models of your own items with an itemLabel function; sourceHeader and targetHeader become sourceHeading and targetHeading; filterBy becomes filter (matching itemLabel); showTargetControls becomes reorder (the target list only); dragdrop becomes dragDrop; item templates use vigListItem.
p-autocompletevig-autocompleteAutocomplete
Differences: suggestions + completeMethod become options + searchRequest with localFilter off; field becomes a displayWith function; allowCustom accepts free text.
p-inputchipsp-chipsvig-input-chipsInputChips
Differences: The value is a string[]; separator becomes separators (a list, comma by default) and Enter always adds; allowDuplicate becomes allowDuplicates, off by default, with an entryKey function for what counts as the same; max becomes maxLength (a Signal Forms maxLength binds it); addOnBlur keeps its name, addOnTab has no equivalent (Tab moves on; use addOnBlur); a paste of several lines or separated entries adds them all; a validator function rejects entries with a message; onAdd, onRemove and onClear become valueChange (with polite announcements); field goes (entries are strings); chips are vig-chip with the arrow keys and Backspace/Delete between them; IME composition is never split.
p-datepickervig-date-pickerDatePicker
Differences: dateFormat (dd/mm/yy) becomes format (dd/MM/yyyy); selectionMode, showTime, hourFormat, minDate and maxDate keep their names.
p-inputnumbervig-number-inputNumberInput
Differences: mode="currency" currency="EUR" becomes currency="EUR"; min, max, step, prefix, suffix, useGrouping and the fraction-digit inputs keep their names.
p-passwordvig-passwordPassword
Differences: feedback is off by default (on in PrimeNG); toggleMask, the strength labels and regexes keep their names.
p-inputotpvig-input-otpInputOtp
Differences: One native input under the boxes instead of one input per box, so SMS autofill (one-time-code), paste and screen readers work; integerOnly becomes charset="numeric" (the default), mask becomes masked (dots drawn over a text input, so no password manager engages), length stays; onComplete becomes (completed); values set from outside are cleaned up; adds groupSize and webOtp.
p-inputmaskvig-input-maskInputMask
Differences: mask keeps the 9 / a / * tokens (or takes typed MaskSlot arrays instead of regex strings); slotChar becomes placeholderChar and only shows while focused; unmask becomes valueFormat ("raw" by default); autoClear is gone (incomplete values are kept; edits that would lose characters are refused); onComplete becomes (completed). Edits go through beforeinput, so the caret holds with Android keyboards and IME.
p-checkboxvig-checkboxCheckbox
Differences: Always binary (a boolean value); for a list of values use several checkboxes.
p-radiobuttonvig-radio-groupRadioGroup
Differences: One group with options replaces one p-radiobutton per choice.
p-toggleswitchvig-toggle-switchToggleSwitch
Differences: Takes a required label.
p-selectbuttonvig-select-buttonSelectButton
Differences: SelectOption<T> options; allowEmpty keeps its name; single choice only.
p-togglebuttonvig-toggle-buttonToggleButton
Differences: onLabel and offLabel keep their names.
p-slidervig-sliderSlider
Differences: A native range input with a label, showValue and ticks; single value only.
p-ratingvig-ratingRating
Differences: stars becomes max; cancel becomes clearable (pick the current value again, or Delete), so no extra cancel icon; onRate/onCancel are the value model (null when cleared); adds allowHalf, a fractional read-only display and a label. iconOnTemplate/iconOffTemplate become icon, the name of a registered glyph whose outline fills. One slider (arrows, Home, End) instead of a radio per star.
p-colorpickervig-color-pickerColorPicker
Differences: inline becomes mode="inline"; format is hex, rgb or hsl and the value is always a string (no object formats, no hsb); onChange is the value model, onShow/onHide are not needed. Adds a typed text field with validation, alpha, presets and the EyeDropper button; the area and sliders are keyboard operable. No appendTo or z-index: the panel uses the CDK overlay.
p-knobvig-knobKnob
Differences: min, max, step and readonly stay; valueTemplate becomes formatValue, a function; size (pixels) becomes size sm, md or lg and scales with the font; valueColor, rangeColor and textColor become theme tokens (--color-primary, --color-muted, --color-foreground) and data-part hooks; strokeWidth is fixed. The wheel is opt-in (wheel) and turns a focused knob only.
p-fileuploadvig-file-uploadFileUpload
Differences: Picks and validates files (accept, maxFileSize, maxFiles) into its value; uploading is your own HttpClient call.
p-tablevig-tablevig-colvigTableCellvigTableCellEditorTableTableColumnTableCellTableCellEditor
Differences: value becomes items; header/body templates become vig-col columns with optional vigTableCell templates; onLazyLoad becomes lazyLoad; dataKey becomes a rowId function. resizableColumns and columnResizeMode (fit, expand) keep their names (in fit mode the last scrolling column is flexible and takes the remaining width, so the table follows its container), with minWidth/maxWidth on vig-col instead of CSS, a keyboard-operable splitter per header and Narrower/Wider buttons in the Columns menu; onColResize becomes columnResized ({ field, width, widths }). reorderableColumns keeps its name; onColReorder becomes columnReordered ({ field, from, to, order }), and the Columns menu adds Move left/right buttons as the keyboard way. pFrozenColumn with frozen and alignFrozen becomes frozen="start" or "end" on vig-col (logical, so RTL follows; frozen columns render first or last, no pFrozenColumn on each cell). virtualScroll keeps its name (true, or "auto" from 200 rows) without virtualScrollItemSize: the row height is measured; scrollHeight stays an input, and a virtual table defaults it to the --vig-table-height token; scrollable needs no flag; frozen, resizable and reorderable columns work with it. Lazy loading of virtual windows (virtualScrollOptions, onLazyLoad per window) is not offered: page the server data or load it whole. stateStorage keeps widths and order through state (columnWidths, columnOrder), without the separate columnWidths string. editMode="cell" with pEditableColumn and pCellEditor input/output templates becomes vig-col editable with a default input (numbers parsed in the locale) or one vigTableCellEditor template whose typed context offers change, commit and cancel; onEditInit/onEditComplete/onEditCancel become one cellEdited ({ row, field, value, previousValue }) and the table never writes into your rows; [validate] (typed with cellValidator) keeps an invalid value in the editor with an inline, announced error; editType="number" parses numbers in the locale; give a rowId so the table recognises the row you replace; editing follows the APG editable grid (Enter keeps focus on the cell, Tab moves to the next editable cell). editMode="row" (pInitEditableRow, pSaveEditableRow) is not offered: edit cell by cell, or put a row form in a dialog. reorderableRows keeps its name, with a handle column instead of pReorderableRowHandle and pReorderableRow; onRowReorder becomes rowReordered ({ row, from, to, items }) carrying the new array, and the handle adds Alt+ArrowUp/ArrowDown and a Move menu (the keyboard and single-pointer ways); rows do not move while sorted, and a virtual table moves them by keys and menu only.
p-paginatorvig-paginatorPaginator
Differences: first and rows are two-way models instead of an onPageChange event.
p-dataviewvig-data-viewDataViewDataViewItem
Differences: value becomes items; the list and grid templates become one vigDataViewItem template with layout in its typed context; layout is a two-way model and layoutToggle adds the switch (no separate p-dataview-layout-options). sortField/sortOrder (string paths) become sort, a typed { by } accessor or { compare } comparator with direction asc or desc. paginator is true or { position, rowsPerPageOptions, jumpToPage, size } with [(first)] and [(rows)], and a new sort returns to the first page; lazy plus onLazyLoad become totalRecords (items is then the server page, which sort only describes) and the models. emptymessage becomes a vigDataViewEmpty template (default: an empty state), loading shows skeleton placeholders (vigDataViewLoading). dataKey becomes an itemId function. No filterBy or virtual scrolling: filter the items yourself and page long lists.
p-timelinevig-timelineTimelineTimelineContent
Differences: value becomes items; content, opposite and marker templates become vigTimelineContent, vigTimelineOpposite and vigTimelineMarker, typed through their …Of inputs. align is start, end (default) or alternate in both orientations, logical so RTL mirrors (no left/right/top/bottom). Renders an <ol>; connectors are borders that forced-colors mode keeps. A two-sided or horizontal timeline narrower than 32rem collapses to one vertical side (a container query).
p-metergroupvig-meter-groupMeterGroup
Differences: value becomes values: { label, value, color? }, where color is a theme color name (primary, success, accent …), not a CSS color, and defaults to METER_GROUP_PALETTE; icon per value is not offered. min is always 0; labelPosition becomes legend (start, end or none) and the label templates become formatValue, a function of the value and max; labelOrientation and orientation="vertical" are not offered. One role="meter" with an aria-valuetext of every segment and the total, a gap between segments, a 2px minimum per segment, and six patterns (forced colors, or patterns in normal mode).
p-dialogvig-dialogvigDialogFooterDialogDialogFooter
Differences: [(visible)] becomes [(open)]; always modal (native <dialog>); dismissableMask becomes closeOnBackdropClick and is on by default; no dragging or resizing.
DialogServiceDynamicDialogDialogsDialogs
Differences: open() returns a VigDialogRef typed from the content: the closed promise replaces onClose; one injectDialogRef() (with .data) replaces DynamicDialogConfig and DynamicDialogRef; size presets replace width and style options; Dialogs is provided in root, so pass injector to reach the providers of the opener.
p-confirmdialogConfirmationServicevig-confirm-dialogConfirmConfirmDialogConfirm
Differences: confirm({ accept, reject }) becomes await confirm.ask({ … }), a Promise<boolean>.
p-drawervig-drawervigDrawerFooterDrawerDrawerFooter
Differences: [(visible)] becomes [(open)]; position takes left, right, top or bottom (no full screen).
p-popovervig-popovervigPopoverTriggervigPopoverContentPopoverPopoverTriggerPopoverContent
Differences: A trigger directive replaces op.toggle($event).
pTooltipvigTooltipTooltip
Differences: tooltipPosition becomes vigTooltipPosition.
p-menuvig-menuvigMenuTriggerMenuMenuTrigger
Differences: model becomes items (label, icon, command or run, href, danger, shortcut); a trigger directive replaces popup + menu.toggle($event); a group on items replaces separator headings.
p-tieredmenuvig-menuvigMenuTriggerMenuMenuTrigger
Differences: vig-menu with nested items: submenus open to the inline end (flipping at the viewport edge and in RTL), with hover intent and the arrow keys; checkbox and radio items via type and checked.
p-menubarvig-menubarMenubar
Differences: model becomes items with the same MenuItem shape as vig-menu; onItemClick becomes selected; narrower than its collapse width (sm by default, measured on its own container in CSS) it turns into one "Menu" button; no start/end templates: put it in a vig-toolbar for those.
p-contextmenuvigContextMenuContextMenu
Differences: A directive on the target ([vigContextMenu]="items") instead of a component with target or global; vigContextMenuData is handed to each item's run; on a vig-table, run receives the row (no contextMenuSelection); also opens with Shift+F10 and the ContextMenu key.
p-toolbarvig-toolbarvigToolbarStartvigToolbarCentervigToolbarEndToolbarToolbarStartToolbarCenterToolbarEnd
Differences: start, center and end templates become vigToolbarStart, vigToolbarCenter and vigToolbarEnd slots; an APG toolbar with one Tab stop and arrow keys between its controls; orientation keeps its name.
p-splitbuttonvig-split-buttonSplitButton
Differences: model becomes items (MenuItem, with submenus); onClick becomes primaryClick; severity becomes variant; the menu button is named from the label (labels.menuAriaLabel).
p-buttongroupvig-button-groupButtonGroup
Differences: Wraps vig-button elements as one role="group" (name it with labels.ariaLabel); orientation adds a vertical stack; each button keeps its own Tab stop (use vig-toolbar for one).
p-tabsvig-tabsvig-tabTabsTab
Differences: One vig-tab per tab and panel instead of p-tablist / p-tabpanels.
p-accordionvig-accordionvig-accordion-itemAccordionAccordionItem
Differences: One vig-accordion-item per panel, with a header input.
p-panelvig-panelvigPanelActionsvigPanelFooterPanelPanelActionsPanelFooter
Differences: header becomes heading (a real h2–h6, headingLevel); toggleable becomes collapsible and collapsed is two-way ([(collapsed)]), so onBeforeToggle/onAfterToggle are not needed; the icons template becomes [vigPanelActions] content and the footer template [vigPanelFooter] content; toggler and the toggle icon templates go: the whole heading is the disclosure button. A collapsed body stays findable (hidden="until-found").
p-fieldsetvig-fieldsetFieldset
Differences: legend keeps its name; toggleable becomes collapsible and collapsed is two-way, so onBeforeToggle/onAfterToggle are not needed; adds disabled, the native fieldset attribute that disables every control inside. Still a native fieldset and legend, with the toggle button inside the legend.
p-splittervig-splittervig-splitter-panelSplitterSplitterPanel
Differences: layout becomes orientation; panelSizes becomes [(sizes)] (two-way, percentages); minSizes becomes minSize on each vig-splitter-panel, which replaces the ng-template panels; gutterSize is styling (data-part="gutter"); stateKey and stateStorage become state (a key, or { key, storage } with local, session or a custom storage, as vig-table); onResizeStart/onResizeEnd become resized ({ sizes, gutter }) once a drag or key press ended. Adds collapsible panels (Enter on the gutter, or a drag below half the minimum), Home/End and Shift+arrows, RTL mirroring and named separators (labels.gutterAriaLabel).
p-breadcrumbvig-breadcrumbBreadcrumb
Differences: model and home become one items list; maxItems collapses long trails.
p-steppervig-stepperStepper
Differences: A steps list and an activeIndex model; render the step content yourself.
p-cardvig-cardvigCardHeadervigCardFooterCardCardHeaderCardFooter
Differences: header input or vigCardHeader slot; padding and elevated replace style classes.
p-dividervig-dividerDivider
Differences: layout becomes orientation; label replaces projected content.
p-toastMessageServicevig-toasterToastToasterToast
Differences: add({ severity, summary, detail, life }) becomes show({ variant, title, message, duration }) or toast.success(message, title).
p-messagevig-messageMessage
Differences: severity becomes variant (warn → warning); closable emits closed.
p-tagvig-tagvigChipIconChipChipIcon
Differences: An alias selector of vig-chip: value becomes label, severity becomes variant, icon becomes a vigChipIcon element; rounded keeps its name.
p-badgevig-badgeBadge
Differences: value becomes label, severity becomes variant; dot shows a status dot.
p-chipvig-chipvigChipIconChipChipIcon
Differences: removable and onRemove become closable and closed; no image slot.
p-avatarvig-avatarAvatar
Differences: image becomes src, label becomes name (initials are derived); shape keeps its name.
p-skeletonvig-skeletonSkeleton
Differences: shape is text, rect or circle; lines stacks text lines.
p-progressbarvig-progress-barProgressBar
Differences: mode="indeterminate" becomes a null value.
p-progressspinnervig-spinnerSpinner
Differences: size is sm, md or lg; variant colors it.
p-scrolltopvig-scroll-topScrollTop
Differences: target (window, parent) and threshold keep their names; behavior goes: scrolling is smooth, and instant with reduced motion; icon and buttonProps become variant and labels.ariaLabel. After scrolling, focus moves to the top (focusTarget, else main or the container). The page is watched by an IntersectionObserver instead of a scroll listener.
p-carouselvig-carouselvigCarouselItemCarouselCarouselItem
Differences: value becomes items with a typed vigCarouselItem template (pTemplate="item" goes); numVisible and responsiveOptions become perView, a number or { base, sm, md, lg, xl } resolved by container queries on the carousel itself (no breakpoint strings, no JS measuring); numScroll goes: buttons and swipes move a page. Scrolling is native scroll snap instead of transforms, so touch, trackpad and keyboard work as in any scroller. page stays as a two-way [(page)] set once scrolling settles (onPage becomes pageChange); circular keeps its name. autoplayInterval becomes autoplay (true or milliseconds, off by default) and always shows a stop/start button, pauses on hover and focus and respects reduced motion. showIndicators becomes indicators; showNavigators, orientation="vertical", header/footer templates and indicator style inputs are not offered (use data-part hooks).
p-imagevig-imageImage
Differences: src, alt, width, height and preview keep their names; previewImageSrc becomes previewSrc; [(open)] opens the viewer from code. imageClass/imageStyle go (data-part="image" or your own projected <img>, which also keeps NgOptimizedImage working); loading is lazy by default, priority for the main image. The preview is a native modal <dialog> with zoom, rotate, reset, panning, wheel and pinch zoom and keys (+ − 0 R, arrows, Escape) instead of the mask overlay; indicator, image and preview templates, showTransitionOptions and appendTo are not offered.
p-galleriavig-galleriavigGalleriaItemvigGalleriaThumbnailvigGalleriaCaptionGalleriaGalleriaItemGalleriaThumbnailGalleriaCaption
Differences: value becomes items (GalleriaImage objects, or your own type extending it, typed in the templates); activeIndex stays two-way; circular keeps its name; showThumbnails becomes thumbnails; pTemplate item, thumbnail and caption become vigGalleriaItem, vigGalleriaThumbnail and vigGalleriaCaption. fullScreen with visible becomes fullscreen and [(open)], showing the same viewer as vig-image (zoom, rotate, arrow keys between images). Thumbnails are an APG tab list in a scroll-snap strip instead of a paged thumbnail carousel, so numVisible and responsiveOptions go; thumbnailsPosition (always below), showIndicators, autoPlay/transitionInterval and showItemNavigatorsOnHover are not offered.
p-treetablevig-tablevig-colTableTableColumnTableCell
Differences: A vig-table with rowChildren: your own row objects instead of TreeNode wrappers; columns and cell templates as in any table. expandedKeys becomes [(expandedRows)] (rows matched by rowId); selection keeps Table's array of rows in every mode, checkbox becomes selectionMode="multiple" with cascade (rowSelectable locks rows); onNodeExpand becomes loadChildren(row, signal); sortMode, filters and the paginator work on the hierarchy (siblings sort within their parent, the paginator pages root rows). Column resizing, reordering, frozen columns and virtualScroll work as in a flat table (measured row height, --vig-table-height instead of scrollHeight="flex"). editable columns work as in a flat table (Enter or F2 on a cell, ttEditableColumn becomes vig-col editable); rows do not reorder (no reorderableRows in tree tables).

Key API differences

  • Inputs are signal inputs with booleans as attributes (clearable instead of [showClear]="true"). Colors are a variant from one shared set — primary, secondary, ghost, info, success, warning, error — where PrimeNG uses severity (warn becomes warning, danger becomes error). Visibility is a two-way open model instead of visible.
  • Labels are built in. Form controls take a required label (floating or on top, hideLabel for tables) instead of a separate <label for> or p-floatlabel; hints and errors render below the field.
  • Outputs drop the on prefix or disappear into models: (onClick) is the native (click), (onChange) is the value model, (onHide) is (openChange), (onRemove) is (closed).
  • Templates become slots. Instead of pTemplate or #header / #footer templates, mark content with a directive: vigButtonIcon, vigDialogFooter, vigTableCell, vigSelectOption, vigMenuItem, vigTabLabel.
  • Options are typed objects.vig-select, vig-multi-select, vig-autocomplete, vig-radio-group and vig-select-button take SelectOption<T> items (value, label, optional icon and disabled). Replace the optionLabel / optionValue strings with a typed mapping function, so a renamed property fails the build instead of rendering blank options. Values compare with ===; for objects use an id as the value.
  • Icons come from a registry (<vig-icon name="check" />, extended with provideVigdxIcons). Icon slots accept any element, so PrimeIcons can stay during the migration.
  • Overlays use the browser's top layer (native modal dialogs) and the CDK overlay; there is no appendTo and no z-index configuration.
  • Translations: provideVigdxUi({ locale }) sets every default label (English and Turkish built in, more through registerVigdxLocale); each label is also an input.

Theming

PrimeNG themes are presets of design tokens compiled at runtime. vigdx tokens are CSS custom properties declared with @theme default in theme.css, so a regular @theme block of yours overrides them and Tailwind generates matching utilities. The semantic primary color of a preset maps onto four tokens; its 50–950 scale onto --color-primary-50 … -950:

Before: app.config.ts
// app.config.ts — PrimeNG 21 styled mode with a custom primary palette
// (PrimeNG 22's config typings take the same theme: { preset, options } shape)
import { providePrimeNG } from 'primeng/config';
import { definePreset } from '@primeuix/themes';
import Aura from '@primeuix/themes/aura';

const Brand = definePreset(Aura, {
  semantic: {
    primary: {
      50: '{indigo.50}',
      100: '{indigo.100}',
      // …
      950: '{indigo.950}',
    },
  },
});

providePrimeNG({ theme: { preset: Brand, options: { darkModeSelector: '.dark' } } });
After: styles.css
/* styles.css — after @import '@vigdx/ui/theme.css' */
@theme {
  /* Fills (buttons, selected states, focus rings) and the text on them */
  --color-primary: #4f46e5;            /* indigo 600 */
  --color-primary-hover: #4338ca;      /* indigo 700 */
  --color-primary-active: #3730a3;     /* indigo 800 */
  --color-primary-foreground: #ffffff;

  /* The full scale, for tints such as primary/10 backgrounds */
  --color-primary-50: #eef2ff;
  --color-primary-100: #e0e7ff;
  /* … */
  --color-primary-950: #1e1b4b;
}

/* Dark mode follows the same .dark class on <html> */
.dark {
  --color-primary: #818cf8;            /* indigo 400 */
  --color-primary-hover: #a5b4fc;      /* indigo 300 */
  --color-primary-active: #c7d2fe;     /* indigo 200 */
  --color-primary-foreground: #0b0e14;
}

If your preset fills with a 500 step, check the text on it: white on Tailwind's 500 steps measures 4.47:1 on indigo, 3.68:1 on blue and 2.54:1 on emerald, all below the 4.5:1 WCAG AA minimum for normal text. The example, like the kit's own default, fills with the 600 step. The same applies to the other semantic families (--color-success, --color-error …) and to radii (--radius-button, --radius-input …); see Theming for every token.

Forms

PrimeNG form components implement ControlValueAccessor. vigdx form controls implement Signal Forms' FormValueControl instead, so [formField] binds value, validation and touched state with no adapter:

address.ts
import { Component, computed, input, signal } from '@angular/core';
import { FormField, form, required } from '@angular/forms/signals';
import { Select, SelectOption } from '@vigdx/ui/select';

interface City {
  code: string;
  name: string;
}

@Component({
  selector: 'app-address',
  imports: [FormField, Select],
  template: `<vig-select label="City" [options]="cityOptions()" [formField]="f.city" />`,
})
export class Address {
  readonly cities = input<City[]>([]);
  // optionLabel="name" optionValue="code", as a typed mapping
  readonly cityOptions = computed<SelectOption<string>[]>(() =>
    this.cities().map((city) => ({ value: city.code, label: city.name })),
  );

  readonly model = signal({ city: null as string | null });
  readonly f = form(this.model, (p) => required(p.city));
}

Existing Reactive Forms (formControlName, [formControl]) and ngModel keep working: import VigValueAccessor next to the component and leave the form model as it is. Validators such as Validators.required show the kit's error messages.

TypeScript
import { ReactiveFormsModule } from '@angular/forms';
import { VigValueAccessor } from '@vigdx/ui/core';
import { Select } from '@vigdx/ui/select';

@Component({
  imports: [ReactiveFormsModule, Select, VigValueAccessor],
  template: `
    <form [formGroup]="form">
      <vig-select label="City" [options]="cityOptions()" formControlName="city" />
    </form>
  `,
})

Empty values are '' for text, null for numbers, dates and single selection, [] for multiple selection and files, and false for booleans.

Incremental adoption

Both libraries can run in one application, so you can move one screen at a time. What vigdx adds to the page, and how it meets PrimeNG's styles:

  • theme.css declares custom properties on :root (--color-*, --radius-*, --shadow-*, the type scale), keyframes for its own animations, and a .dark block. It has no other selectors, and no names start with PrimeNG's --p- prefix.
  • Components carry no stylesheets of their own: they are styled with Tailwind utility classes on their own elements, which Tailwind emits in its utilities cascade layer. They never use PrimeNG's class names.
  • @import 'tailwindcss' brings Preflight, a reset in the base layer: margins, list styles, borders and form control appearance of plain elements change across the whole app. vigdx is built and tested with Preflight, so keep it, and review your own markup and PrimeNG screens once it is in.
  • Preflight sets the page font from --font-sans, which theme.css points at Montserrat (and it redefines Tailwind's type scale). Set --font-sans in your @theme to keep your current font.
  • Styles outside any cascade layer beat every layer. If PrimeNG's styles are unlayered they win over Preflight on PrimeNG's elements, which is usually what you want. If you place them in a layer, declare it after base and before utilities:
styles.css
/* styles.css — only if PrimeNG's styles are placed in a "primeng" layer */
@layer theme, base, primeng, components, utilities;

@import 'tailwindcss';
@import '@angular/cdk/overlay-prebuilt.css';
@import '@vigdx/ui/theme.css';
  • Dark mode: vigdx switches on a .dark class on <html>. Configure PrimeNG's darkModeSelector with the same class so both follow one toggle.
  • Overlays: vig-dialog, vig-drawer and Dialogs are native modal dialogs, so everything outside the dialog's DOM subtree is inert while it is open — including overlay panels another library appends to <body>. Inside a vigdx dialog, use vigdx controls (provideVigdxUi() keeps the CDK-based panels working) and migrate a dialog together with its content.
  • vigdx panels render in the CDK overlay container on <body> (z-index: 1000). If one opens behind a PrimeNG dialog, raise the .cdk-overlay-container z-index above PrimeNG's modal layer, or migrate that dialog first.
  • provideVigdxUi() replaces the CDK OverlayContainer: while a vigdx modal is open, the container moves into it; otherwise it stays on <body>. Other CDK-based libraries share that container.

TipA migration order that works

Start with the app shell (vig-toaster, vig-confirm-dialog, theme tokens), then leaf components on new screens (buttons, tags, badges), then forms one screen at a time, and dialogs together with everything they contain.

Before and after

Button

Before
<p-button
  label="Save"
  icon="pi pi-check"
  severity="success"
  [loading]="saving()"
  (onClick)="save()"
/>
After
<!-- imports: [Button, ButtonIcon, Icon] -->
<vig-button label="Save" variant="success" [loading]="saving()" (click)="save()">
  <vig-icon vigButtonIcon name="check" />
  <!-- or keep the icon font: <i vigButtonIcon class="pi pi-check" aria-hidden="true"></i> -->
</vig-button>

Select in a reactive form

Before
<label for="status">Status</label>
<p-select
  inputId="status"
  [options]="statuses"
  optionLabel="name"
  optionValue="id"
  [showClear]="true"
  [filter]="true"
  placeholder="Any status"
  formControlName="status"
/>
After
<!-- imports: [ReactiveFormsModule, Select, VigValueAccessor] -->
<vig-select
  label="Status"
  [options]="statusOptions"
  clearable
  filter
  placeholder="Any status"
  formControlName="status"
/>

<!-- statusOptions: SelectOption<number>[] =
       statuses.map((s) => ({ value: s.id, label: s.name })) -->

Table

Before
<p-table
  [value]="orders()"
  [paginator]="true"
  [rows]="10"
  dataKey="id"
  selectionMode="multiple"
  [(selection)]="selected"
>
  <ng-template #header>
    <tr>
      <th pSortableColumn="customer">Customer <p-sortIcon field="customer" /></th>
      <th>Total</th>
      <th>Status</th>
    </tr>
  </ng-template>
  <ng-template #body let-order>
    <tr>
      <td>{{ order.customer }}</td>
      <td>{{ order.total | currency }}</td>
      <td><p-tag [value]="order.status" [severity]="severityOf(order)" /></td>
    </tr>
  </ng-template>
</p-table>
After
<!-- imports: [Table, TableColumn, TableCell, Chip, CurrencyPipe] -->
<vig-table
  caption="Orders"
  [items]="orders()"
  paginator
  [rows]="10"
  [rowId]="byId"
  selectionMode="multiple"
  [(selection)]="selected"
>
  <vig-col field="customer" header="Customer" sortable rowHeader />
  <vig-col field="total" header="Total" align="end">
    <ng-template vigTableCell let-order>{{ order.total | currency }}</ng-template>
  </vig-col>
  <vig-col header="Status">
    <ng-template vigTableCell let-order>
      <vig-tag [label]="order.status" [variant]="variantOf(order)" size="sm" />
    </ng-template>
  </vig-col>
</vig-table>

<!-- byId = (order: Order) => order.id -->

Dialog opened from code

PrimeNG's DialogService is provided per component, so dialog content inherits the opener's providers. Dialogs is provided in root: from an event handler, pass injector: inject(Injector) (kept in a field) to give the content the opener's component and route providers. Called from a constructor or field initializer, open() uses the caller's injector by itself.

Before
// The opener (providers: [DialogService])
const ref = this.dialogService.open(EditUser, {
  header: 'Edit user',
  width: '40rem',
  data: { id },
  dismissableMask: true,
}); // DynamicDialogRef<EditUser> | null
ref?.onClose.subscribe((user?: User) => {
  if (user) this.users.save(user);
});

// Inside EditUser
private readonly config = inject(DynamicDialogConfig);
private readonly ref = inject(DynamicDialogRef);
save() {
  this.ref.close(this.user());
}
After
// The opener. Dialogs is provided in root, so pass this component's
// injector: the content then sees its providers and its route's.
private readonly dialogs = inject(Dialogs);
private readonly injector = inject(Injector);

async edit(id: string) {
  const ref = this.dialogs.open(EditUser, {
    heading: 'Edit user',
    size: 'lg',
    data: { id }, // required and type-checked against EditUser
    injector: this.injector,
  });
  const user = await ref.closed; // User | undefined, inferred from EditUser
  if (user) this.users.save(user);
}

// Inside EditUser: one helper for the data and the way out. It must be a
// public readonly field named dialogRef for open() to read its types.
readonly dialogRef = injectDialogRef<User, { id: string }>();
save() {
  this.dialogRef.close(this.user());
}

Confirmation and toast

Before
// <p-toast /> and <p-confirmdialog /> in the app shell
this.confirmationService.confirm({
  header: 'Delete order?',
  message: 'This cannot be undone.',
  acceptLabel: 'Delete',
  accept: () => {
    this.orders.delete(id);
    this.messageService.add({ severity: 'success', summary: 'Deleted', detail: 'Order removed' });
  },
});
After
// <vig-toaster /> and <vig-confirm-dialog /> in the app shell
const confirmed = await this.confirm.ask({
  heading: 'Delete order?',
  message: 'This cannot be undone.',
  acceptLabel: 'Delete',
  variant: 'error',
});
if (confirmed) {
  this.orders.delete(id);
  this.toast.success('Order removed', 'Deleted');
}

Are you sure?