01Two ways to customize, one of them is a trap

You can make PrimeNG match a brand two ways: override component internals with targeted CSS selectors, or configure PrimeUIX's token-based preset system to redefine the design tokens the components already read from. The first feels faster in the moment. The second is the one that survives a version upgrade.

CSS overrides target implementation details (internal class names, DOM structure) that PrimeNG doesn't guarantee stability on between versions. A token-based preset targets a documented, stable API surface instead.

02A workflow that holds up

  1. 01

    Start from the preset, not from Aura's defaults in place

    Extend PrimeUIX's base preset (definePreset) with your palette from day one, rather than shipping the default theme and patching colors later across dozens of screens.

  2. 02

    Map brand colors to semantic tokens, not component props

    Set primary, surface and formField tokens once in the preset. Every button, input and card across the app inherits it, so there is no per-component color prop to remember or miss.

  3. 03

    Define light and dark variants in the same preset

    PrimeUIX supports per-mode token values directly in the preset definition. Define both there rather than adding a separate dark: CSS override layer on top of the theme.

  4. 04

    Reserve component-level pt (passthrough) props for real one-offs

    PrimeNG's passthrough API is the correct escape hatch for a unique instance. If you're reaching for it on every instance of a component, the preset is missing a token.

  5. 05

    Keep the preset in version control as its own module

    Treat the theme preset as a first-class file a designer or engineer can review on its own, not scattered token overrides mixed into feature-level SCSS.

  6. 06

    Re-test the preset on every major PrimeNG upgrade

    Token names occasionally shift between major versions. A five-minute visual check of core components after upgrading catches this far cheaper than a support ticket weeks later.

03Why this matters more than it looks like it should

A CSS-override-heavy theme accumulates silently. Each individual override looks harmless on its own PR, but two years in, upgrading PrimeNG becomes a project of its own. Every overridden selector needs re-verification against the new DOM structure, and some will have broken without anyone noticing until a user reports a visual bug.

A token-based preset doesn't eliminate that risk entirely, but it shrinks the surface area dramatically: a documented API instead of implementation details you were never meant to depend on.

04A preset is just a TypeScript module

With PrimeNG's styled mode, the whole brand lives in one file: definePreset extends Aura, maps the primary palette to your brand through token references, and defines light and dark surfaces side by side under colorScheme.

Because the preset is plain TypeScript, it's reviewed, versioned and diffed like any other code. On a PrimeNG upgrade, you re-test one file instead of hunting for component overrides across the app.

theme/app-preset.ts
import { definePreset } from '@primeuix/themes';
import Aura from '@primeuix/themes/aura';

export const AppPreset = definePreset(Aura, {
  semantic: {
    primary: {
      50: '{indigo.50}',
      100: '{indigo.100}',
      // ...200 – 900
      950: '{indigo.950}',
    },
    colorScheme: {
      light: { surface: { 0: '#ffffff', 50: '{stone.50}', 900: '{stone.900}' } },
      dark: { surface: { 0: '#ffffff', 900: '{stone.900}', 950: '{stone.950}' } },
    },
  },
});

// app.config.ts → providePrimeNG({ theme: { preset: AppPreset } })

The takeaway

Theme PrimeNG through PrimeUIX's token-based preset system, not CSS selectors chasing internal class names. Map brand colors to semantic tokens once, define light and dark in the same preset, and reserve passthrough props for genuine one-offs — and the next major-version upgrade becomes a five-minute visual check instead of a multi-week re-theming project.

Written by Jaymin MahetaSenior UI/UX Developer turning Figma designs into fast, accessible enterprise apps in Angular and React.
About me →