Skip to content

Types

ThemeBuilderState

The main state interface used by the theme builder. Every property maps to a visual control in the builder UI.

ts
import type { ThemeBuilderState } from "primevue-theme-builder";
PropertyTypeDefaultDescription
namestring"Custom"Theme display name
baseThemeBaseTheme"Aura"PrimeVue base theme to extend
primaryHuenumber210Primary color hue (0–360)
primarySaturationnumber30Primary saturation (0–100)
primaryLightnessnumber50Primary lightness (0–100)
accentHuenumber35Accent color hue (0–360)
accentSaturationnumber70Accent saturation (0–100)
accentLightnessnumber50Accent lightness (0–100)
surfaceHuenumber35Surface/neutral hue (0–360)
surfaceSaturationnumber8Surface saturation (0–100)
borderRadiusnumber10Component border radius in px
cardBorderRadiusnumber16Card border radius in px
paddingScalenumber100Padding scale as percentage
fontWeightnumber500Base font weight
shadowIntensitynumber50Shadow intensity (0–100)
focusRingStyleFocusRingStyle"dashed"Focus ring style
titleFontGoogleFont"Playfair Display"Title/heading font family
bodyFontGoogleFont"Inter"Body text font family
buttonPaddingXnumber1.25Button horizontal padding in rem
buttonPaddingYnumber0.625Button vertical padding in rem
alertSuccessHuenumber142Success alert color hue
alertWarnHuenumber45Warning alert color hue
alertErrorHuenumber0Error alert color hue
alertInfoHuenumber210Info alert color hue

Default Values

ts
import { defaults } from "primevue-theme-builder";

console.log(defaults);
// { name: "Custom", baseTheme: "Aura", primaryHue: 210, ... }

SavedTheme

A persisted theme entry.

ts
import type { SavedTheme } from "primevue-theme-builder";
ts
interface SavedTheme {
  id: string;
  state: ThemeBuilderState;
}

FocusRingStyle

ts
type FocusRingStyle = "dashed" | "solid" | "none";

BaseTheme

Available PrimeVue base themes to extend.

ts
type BaseTheme = "Aura" | "Material" | "Lara" | "Nora";

GoogleFont

Union type of all supported Google Font family names. Currently includes 48 fonts.

ts
import type { GoogleFont } from "primevue-theme-builder";

See the full list:

ts
import { GOOGLE_FONTS } from "primevue-theme-builder";

console.log(GOOGLE_FONTS);
// ["Inter", "Roboto", "Open Sans", "Lato", "Montserrat", ...]

ColorPalette

A mapping of shade numbers to hex color strings.

ts
type ColorPalette = Record<number, string>;

Standard shades: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950.

ts
import { PALETTE_SHADES } from "primevue-theme-builder";
// readonly [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950]