Adds an Appearance Settings tab to an existing collection or a standalone global so editors can restyle a site from the Payload admin. It ships 60+ colour themes and 17 style presets, and renders theme CSS variables server-side in a Next.js layout. It requires Payload 3, Next.js 14 to 16, React 18.3 or newer and lucide-react.
Theme configuration plugin for Payload CMS v3 with 60+ professional themes and standalone collection support
Installation
npm i @kilivi/payloadcms-theme-management9
Stars
1
Forks
0
Open Issues
3 weeks ago
Last Updated
137
Weekly Downloads
v2.4.0
npm Version
2.3 MB
Unpacked Size
3
Dependencies
90 since Sep 7
| Date | Stars |
|---|---|
| Dec 6, 2026 | 9 |
| Dec 5, 2026 | 9 |
| Dec 4, 2026 | 9 |
| Dec 3, 2026 | 9 |
| Dec 2, 2026 | 9 |
| Dec 1, 2026 | 9 |
| Nov 30, 2026 | 9 |
| Nov 29, 2026 | 9 |
| Nov 28, 2026 | 9 |
| Nov 27, 2026 | 9 |
| Nov 26, 2026 | 9 |
| Nov 25, 2026 | 9 |
| Nov 24, 2026 | 9 |
| Nov 23, 2026 | 9 |
| Nov 22, 2026 | 9 |
| Nov 21, 2026 | 9 |
| Nov 20, 2026 | 9 |
| Nov 19, 2026 | 9 |
| Nov 18, 2026 | 9 |
| Nov 17, 2026 | 9 |
| Nov 16, 2026 | 9 |
| Nov 15, 2026 | 9 |
| Nov 14, 2026 | 9 |
| Nov 13, 2026 | 9 |
| Nov 12, 2026 | 9 |
| Nov 11, 2026 | 9 |
| Nov 10, 2026 | 9 |
| Nov 9, 2026 | 9 |
| Nov 8, 2026 | 9 |
| Nov 7, 2026 | 9 |
| Nov 6, 2026 | 9 |
| Nov 5, 2026 | 9 |
| Nov 4, 2026 | 9 |
| Nov 3, 2026 | 9 |
| Nov 2, 2026 | 9 |
| Nov 1, 2026 | 9 |
| Oct 31, 2026 | 9 |
| Oct 30, 2026 | 9 |
| Oct 29, 2026 | 9 |
| Oct 28, 2026 | 9 |
| Oct 27, 2026 | 9 |
| Oct 26, 2026 | 9 |
| Oct 25, 2026 | 9 |
| Oct 24, 2026 | 9 |
| Oct 23, 2026 | 9 |
| Oct 22, 2026 | 9 |
| Oct 21, 2026 | 9 |
| Oct 20, 2026 | 9 |
| Oct 19, 2026 | 9 |
| Oct 18, 2026 | 9 |
| Oct 17, 2026 | 9 |
| Oct 16, 2026 | 9 |
| Oct 15, 2026 | 9 |
| Oct 14, 2026 | 9 |
| Oct 13, 2026 | 9 |
| Oct 12, 2026 | 9 |
| Oct 11, 2026 | 9 |
| Oct 10, 2026 | 9 |
| Oct 9, 2026 | 9 |
| Oct 8, 2026 | 9 |
| Oct 7, 2026 | 9 |
| Oct 6, 2026 | 9 |
| Oct 5, 2026 | 9 |
| Oct 4, 2026 | 9 |
| Oct 3, 2026 | 9 |
| Oct 2, 2026 | 9 |
| Oct 1, 2026 | 9 |
| Sep 30, 2026 | 9 |
| Sep 29, 2026 | 9 |
| Sep 28, 2026 | 9 |
| Sep 27, 2026 | 9 |
| Sep 26, 2026 | 9 |
| Sep 25, 2026 | 9 |
| Sep 24, 2026 | 9 |
| Sep 23, 2026 | 9 |
| Sep 22, 2026 | 9 |
| Sep 21, 2026 | 9 |
| Sep 20, 2026 | 9 |
| Sep 19, 2026 | 9 |
| Sep 18, 2026 | 9 |
| Sep 17, 2026 | 9 |
| Sep 16, 2026 | 9 |
| Sep 15, 2026 | 9 |
| Sep 14, 2026 | 9 |
| Sep 13, 2026 | 9 |
| Sep 12, 2026 | 9 |
| Sep 11, 2026 | 9 |
| Sep 10, 2026 | 9 |
| Sep 9, 2026 | 9 |
| Sep 8, 2026 | 9 |
| Sep 7, 2026 | 9 |
Shared by 3 plugins in vitakili/payload-plugins.
137+56 since Sep 7
| Date | Weekly downloads |
|---|---|
| Dec 6, 2026 | 137 |
| Dec 5, 2026 | 145 |
| Dec 4, 2026 | 145 |
| Dec 3, 2026 | 227 |
| Dec 2, 2026 | 226 |
| Dec 1, 2026 | 216 |
| Nov 30, 2026 | 216 |
| Nov 29, 2026 | 230 |
| Nov 28, 2026 | 224 |
| Nov 27, 2026 | 218 |
| Nov 26, 2026 | 151 |
| Nov 25, 2026 | 158 |
| Nov 24, 2026 | 124 |
| Nov 23, 2026 | 129 |
| Nov 22, 2026 | 129 |
| Nov 21, 2026 | 172 |
| Nov 20, 2026 | 174 |
| Nov 19, 2026 | 176 |
| Nov 18, 2026 | 183 |
| Nov 17, 2026 | 162 |
| Nov 16, 2026 | 163 |
| Nov 15, 2026 | 164 |
| Nov 14, 2026 | 138 |
| Nov 13, 2026 | 136 |
| Nov 12, 2026 | 136 |
| Nov 11, 2026 | 230 |
| Nov 10, 2026 | 315 |
| Nov 9, 2026 | 329 |
| Nov 8, 2026 | 330 |
| Nov 7, 2026 | 345 |
| Nov 6, 2026 | 360 |
| Nov 5, 2026 | 514 |
| Nov 4, 2026 | 423 |
| Nov 3, 2026 | 511 |
| Nov 2, 2026 | 511 |
| Nov 1, 2026 | 494 |
| Oct 31, 2026 | 552 |
| Oct 30, 2026 | 687 |
| Oct 29, 2026 | 509 |
| Oct 28, 2026 | 484 |
| Oct 27, 2026 | 311 |
| Oct 26, 2026 | 294 |
| Oct 25, 2026 | 289 |
| Oct 24, 2026 | 238 |
| Oct 23, 2026 | 73 |
| Oct 22, 2026 | 77 |
| Oct 21, 2026 | 99 |
| Oct 20, 2026 | 95 |
| Oct 19, 2026 | 91 |
| Oct 18, 2026 | 96 |
| Oct 17, 2026 | 58 |
| Oct 16, 2026 | 74 |
| Oct 15, 2026 | 74 |
| Oct 14, 2026 | 130 |
| Oct 13, 2026 | 128 |
| Oct 12, 2026 | 127 |
| Oct 11, 2026 | 147 |
| Oct 10, 2026 | 153 |
| Oct 9, 2026 | 149 |
| Oct 8, 2026 | 163 |
| Oct 7, 2026 | 92 |
| Oct 6, 2026 | 101 |
| Oct 5, 2026 | 111 |
| Oct 4, 2026 | 120 |
| Oct 3, 2026 | 248 |
| Oct 2, 2026 | 245 |
| Oct 1, 2026 | 231 |
| Sep 30, 2026 | 228 |
| Sep 29, 2026 | 217 |
| Sep 28, 2026 | 208 |
| Sep 27, 2026 | 176 |
| Sep 26, 2026 | 36 |
| Sep 25, 2026 | 30 |
| Sep 24, 2026 | 28 |
| Sep 23, 2026 | 28 |
| Sep 22, 2026 | 30 |
| Sep 21, 2026 | 99 |
| Sep 20, 2026 | 98 |
| Sep 19, 2026 | 104 |
| Sep 18, 2026 | 103 |
| Sep 17, 2026 | 113 |
| Sep 16, 2026 | 118 |
| Sep 15, 2026 | 115 |
| Sep 14, 2026 | 48 |
| Sep 13, 2026 | 48 |
| Sep 12, 2026 | 79 |
| Sep 11, 2026 | 90 |
| Sep 10, 2026 | 81 |
| Sep 9, 2026 | 83 |
| Sep 8, 2026 | 81 |
| Sep 7, 2026 | 81 |
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/1070225561-theme-management)<a href="https://payloaddirectory.dev/plugins/1070225561-theme-management"><img src="https://payloaddirectory.dev/badge/1070225561-theme-management.svg" alt="Payload Directory"></a>README
Theme management for Payload CMS v3: 60+ presets, a live preview inside the admin, an accessibility audit, and theme CSS variables that are rendered server-side (SSR-ready) for your Next.js front-end. It is built so that a non-technical site owner can restyle a site from the Payload admin without breaking it.
Repository: github.com/vitakili/payload-plugins → packages/theme-management · Changelog · Issues
Package name: the plugin is published as
@kilivi/payloadcms-theme-management. Versions 1.x–2.1.x were also published under@kilivi-dev/payloadcms-theme-management, which is no longer updated. See Migrating from@kilivi-dev.
primary and primaryForeground) also show their contrast right in the field.@theme and Tailwind v3 config. Custom presets can be imported as JSON and appear in the theme picker straight away.ServerThemeInjector), <meta name="theme-color">, cache revalidation and Payload Live Preview.ColorModeToggle (light/dark/auto) and ThemeSwitcher.prefers-reduced-motion. It ships with English and Czech admin translations, and you can add more.pnpm add @kilivi/payloadcms-theme-management
# or
npm i @kilivi/payloadcms-theme-management
# or
yarn add @kilivi/payloadcms-theme-management
Peer dependencies:
| Package | Versions |
|---|---|
payload, @payloadcms/ui | ^3 |
next | 14 / 15 / 16 |
react | 18.3+ or 19 |
lucide-react | >=0.400 |
import { themeManagementPlugin } from '@kilivi/payloadcms-theme-management'
import { buildConfig } from 'payload'
export default buildConfig({
collections: [
{
slug: 'site-settings',
fields: [{ name: 'siteName', type: 'text' }],
},
],
plugins: [
themeManagementPlugin({
targetCollection: 'site-settings',
defaultTheme: 'cool',
livePreview: true,
}),
],
})
import { themeManagementPlugin } from '@kilivi/payloadcms-theme-management'
import { buildConfig } from 'payload'
export default buildConfig({
plugins: [
themeManagementPlugin({
useStandaloneCollection: true,
standaloneCollectionSlug: 'appearance-settings',
standaloneCollectionLabel: 'Appearance Settings',
defaultTheme: 'cool',
livePreview: true,
}),
],
})
After adding the plugin, regenerate the admin import map:
pnpm payload generate:importmap
import { ServerThemeInjector } from '@kilivi/payloadcms-theme-management/server'
import configPromise from '@payload-config'
import { getPayload } from 'payload'
export default async function RootLayout({ children }: { children: React.ReactNode }) {
const payload = await getPayload({ config: configPromise })
const appearance = await payload.findGlobal({
slug: 'appearance-settings',
})
return (
<html lang="en">
<head>
<ServerThemeInjector themeConfiguration={appearance?.themeConfiguration} />
</head>
<body>{children}</body>
</html>
)
}
That is all an app needs — fonts included. ServerThemeInjector loads the
theme's fonts (the body and heading font, whether a preset or the editor chose
them) with no setup and no build step:
@font-face rules are inlined into the page, trimmed to Latin + Latin
Extended (~1–4 KiB instead of Google's ~20 KiB), so there is no stylesheet
request for the first paint to wait on;/api/theme-fonts/file
(fetched once from Google on the server, cached on disk, immutable for a
year) — visitors never contact Google (GDPR-friendly);Options: fontSubsets (e.g. add 'cyrillic'), preloadFonts={false},
fontLoading ('self-hosted' default, 'google' for the Google CDN, 'none'
when you load faces yourself).
A page with its own typography (a menu, a landing page) loads any catalog font the same way:
import { ThemeFontFaces } from '@kilivi/payloadcms-theme-management/server'
import { fontFamilyFor } from '@kilivi/payloadcms-theme-management'
<ThemeFontFaces fonts={['Outfit']} />
<h1 style={{ fontFamily: fontFamilyFor('Outfit') }}>Menu</h1>
next/fontIf you prefer build-time fonts, @kilivi/payloadcms-theme-management/next-fonts
declares every catalog font with next/font/google (preload: false). This
downloads fonts during next build and adds to its time and memory:
import { themeFontVariables } from '@kilivi/payloadcms-theme-management/next-fonts'
<html lang="en" className={themeFontVariables}>
<head>
<ServerThemeInjector themeConfiguration={appearance?.themeConfiguration} fontLoading="none" />
</head>
If your Next.js setup does not compile packages from node_modules, add
'@kilivi/payloadcms-theme-management' to transpilePackages in next.config.
Pass fontLoading="none" to ThemeLivePreviewSync as well if you use it.
To host only some catalog fonts yourself, declare them with the catalog's CSS
variable (variable: '--font-lora' for Lora) and name them in
selfHostedFonts={['Lora']} (also on ThemeLivePreviewSync); the plugin loads
the rest.
The tab is ordered as a presets first, fine-tuning second workflow:
livePreview option), the real site is the preview: the tab shows an Open Live Preview button instead of a mock, and nothing while the panel is open, so the fields get the full width. Without it, one mock preview covers colours, fonts and component styles. Once the settings group is at least 960 px wide (a container query, not the viewport width), it moves into a sticky right-hand column that stays visible while you edit anything below it.The generated CSS applies the chosen fonts to body and headings with
zero-specificity :where() rules — only once the editor has picked typography,
so untouched sites render as before and your own CSS always wins.
Each bulk action honours the locks:
| Action | Colours | Fonts | Style (effects, components, radius) |
|---|---|---|---|
| Pick a theme preset | writes colours | pins the current preset font instead of switching it | writes the theme's visual effects |
| Pick a style preset | never | writes the style's typography | writes effects, components, radius, motion and spacing |
| Generate a palette | writes colours (disabled while locked) | never | never |
Payload's Live Preview points at your client pages by slug:
home slug resolves to //{slug}themeManagementPlugin({
livePreview: true,
})
themeManagementPlugin({
livePreview: {
enabled: true,
injectRoute: true,
routePath: '/theme/preview',
pageCollection: 'pages',
pageSlug: 'home',
fallbackToFirstPage: true,
tenantField: 'tenant',
tenantQueryParam: 'tenant',
breakpoints: [
{ name: 'tablet', label: 'Tablet', width: 1024, height: 768 },
{ name: 'desktop', label: 'Desktop', width: 1440, height: 900 },
],
},
})
With livePreview.injectRoute enabled, the plugin adds GET /api/theme/preview (or your custom routePath).
pageSlugpreviewSecret (or preview)tenantPREVIEW_SECRET or PAYLOAD_PREVIEW_SECRET.307 redirects to the resolved client page401 means a secret is configured but is missing or wrong/api/theme/preview?pageSlug=home&previewSecret=your-secret → /
/api/theme/preview?pageSlug=home&tenant=acme&previewSecret=your-secret → /?tenant=acme
Testing tip: preview is most useful when the previewed page uses many theme tokens: buttons, cards, banners, links and several heading levels. The repository's dev-local app includes pnpm seed:theme, which fills the home page with blocks like these.
themeManagementPlugin({
useStandaloneCollection: true,
standaloneCollectionSlug: 'appearance-settings',
livePreview: {
enabled: true,
injectRoute: true,
routePath: '/theme/preview',
pageCollection: 'pages',
pageSlug: 'home',
tenantField: 'tenant',
tenantQueryParam: 'tenant',
},
cacheRevalidation: {
enabled: true,
injectRoute: true,
routePath: '/theme/revalidate',
secret: process.env.THEME_REVALIDATE_SECRET,
tags: ['tenant:acme'],
paths: ['/'],
},
})
See MULTI_TENANT_GUIDE.md for shared vs per-tenant setups.
When useStandaloneCollection: true, the default cache tag is global_{standaloneCollectionSlug}. The plugin can inject POST /api/theme/revalidate:
themeManagementPlugin({
useStandaloneCollection: true,
cacheRevalidation: {
enabled: true,
injectRoute: true,
routePath: '/theme/revalidate',
secret: process.env.THEME_REVALIDATE_SECRET,
tags: ['tenant:default'],
paths: ['/'],
},
})
import {
createCachedThemeFetcher,
ServerThemeInjector,
} from '@kilivi/payloadcms-theme-management/server'
import configPromise from '@payload-config'
import { getPayload } from 'payload'
const getCachedTheme = createCachedThemeFetcher({
globalSlug: 'appearance-settings',
revalidate: 3600,
loadAppearanceSettings: async () => {
const payload = await getPayload({ config: configPromise })
return payload.findGlobal({ slug: 'appearance-settings' })
},
})
export default async function RootLayout({ children }: { children: React.ReactNode }) {
const themeConfiguration = await getCachedTheme()
return (
<html lang="en">
<head>
<ServerThemeInjector themeConfiguration={themeConfiguration} />
</head>
<body>{children}</body>
</html>
)
}
import { fetchThemeConfiguration } from '@kilivi/payloadcms-theme-management'
// Single tenant
const themeConfiguration = await fetchThemeConfiguration({
useGlobal: true,
collectionSlug: 'appearance-settings',
})
// Multi-tenant
const tenantThemeConfiguration = await fetchThemeConfiguration({
useGlobal: true,
collectionSlug: 'appearance-settings',
tenantSlug: 'acme',
})
| Option | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Enables or disables the plugin |
targetCollection | string | 'site-settings' | Collection slug for tab mode |
useStandaloneCollection | boolean | false | Creates a standalone global instead of injecting a tab |
standaloneCollectionSlug | string | 'appearance-settings' | Global slug in standalone mode |
standaloneCollectionLabel | string | Record<string, string> | translated label | Label of the standalone global |
themePresets | ThemePreset[] | built-in presets | Custom preset list |
defaultTheme | string | 'cool' | Default preset name |
includeColorModeToggle | boolean | true | Colour mode section (light/dark tokens, audit, export) |
includeCustomCSS | boolean | true | Enables the custom CSS field |
enableAdvancedFeatures | boolean | true | Advanced controls such as animation level |
customThemeConfigurationFields | Field[] | undefined | Extra fields appended inside the themeConfiguration group |
customThemeConfigurationSections | Array<{ label; fields; initCollapsed?; description? }> | undefined | Extra collapsible sections inside the group |
enableLogging | boolean | false | Logs plugin actions |
livePreview | boolean | ThemeManagementLivePreviewOptions | true | Live preview URL behaviour |
cacheRevalidation | boolean | ThemeManagementCacheRevalidationOptions | on in standalone mode | Cache invalidation endpoint, tags and paths |
i18n | ThemeManagementI18nOptions | undefined | Extend or override admin translations |
includeBrandIdentity | boolean | false | Reserved for future use |
livePreview options| Option | Type | Default |
|---|---|---|
enabled | boolean | true |
injectRoute | boolean | false |
routePath | string | '/theme/preview' |
pageCollection | string | 'pages' |
pageSlug | string | 'home' |
fallbackToFirstPage | boolean | true |
tenantField | string | 'tenant' |
tenantQueryParam | string | 'tenant' |
breakpoints | Array<{ name; label; width; height }> | undefined |
url | (args) => string | Promise<string> | slug-based URL |
cacheRevalidation options| Option | Type | Default |
|---|---|---|
enabled | boolean | true in standalone mode, otherwise false |
injectRoute | boolean | true |
routePath | string | '/theme/revalidate' |
secret | string | undefined |
tags | string[] | [global_{slug}] |
paths | string[] | [] |
The plugin ships with English (en) and Czech (cs) admin translations. It registers them in Payload's native config.i18n under the theme-management namespace.
{ en, cs, … }) resolve to the admin language first, then to English.To add languages or override strings, use the i18n option. It is deep-merged over the built-in strings, and missing keys fall back to English.
import { de } from '@payloadcms/translations/languages/de'
themeManagementPlugin({
i18n: {
translations: {
de: { tabLabel: 'Darstellung', ui: { lightMode: 'Heller Modus' } },
en: { tabLabel: 'Theme' }, // override a built-in string
},
supportedLanguages: { de }, // optional: register a new admin language
},
})
Full guide: docs/TRANSLATIONS.md
| Section | Admin group | Fields |
|---|---|---|
| Visual effects | themeConfiguration.visualEffects | effectStyle, shadowIntensity, backdropBlur, borderStyle, borderWidth, glassOpacity |
| Component styles | themeConfiguration.componentStyles | buttonVariant, buttonSize, cardStyle, cardHoverEffect, navbarStyle, footerStyle, imageStyle, linkStyle, enableScrollReveal, enableHoverAnimations |
| Typography | themeConfiguration.typography | bodyFont, headingFont, bodyFontCustom, headingFontCustom, baseFontSize, lineHeight |
heroBackground (hero style, patterns, dividers) is part of the ThemeHeroBackground type and the CSS generator, but the tab has no admin fields for it. Add them through customThemeConfigurationSections if you need them.
Full reference: docs/APPEARANCE_CONTROLS.md
import { fetchThemeConfiguration } from '@kilivi/payloadcms-theme-management'
const theme = await fetchThemeConfiguration({ collectionSlug: 'site-settings' })
const effect = theme?.visualEffects?.effectStyle ?? 'flat'
const button = theme?.componentStyles?.buttonVariant ?? 'filled'
return (
<html data-effect={effect} data-button={button}>
...
</html>
)
Built-in presets are exported as allThemePresets, and style presets as allStylePresets:
import { allStylePresets, allThemePresets } from '@kilivi/payloadcms-theme-management'
Editors can also import extra presets as JSON (Custom theme presets section). They are merged into the theme picker, and they override built-in presets that have the same name.
Full preset reference: docs/THEME_PRESETS_EXTENDED.md
import ColorModeToggle from '@kilivi/payloadcms-theme-management/components/ColorModeToggle'
import ThemeSwitcher from '@kilivi/payloadcms-theme-management/components/ThemeSwitcher'
import {
allStylePresets,
allThemePresets,
fetchThemeConfiguration,
generateThemeColorsCss,
generateThemeCSS,
getAvailableThemePresets,
getThemeHtmlAttributes,
getThemePreset,
getThemeStyles,
resolveThemeConfiguration,
themeManagementPlugin,
ThemeProvider,
} from '@kilivi/payloadcms-theme-management'
import type {
SiteThemeConfiguration,
ThemeComponentStyles,
ThemeHeroBackground,
ThemeVisualEffects,
} from '@kilivi/payloadcms-theme-management'
import {
createCachedThemeFetcher,
getThemeCacheTag,
getThemeCriticalCSS,
getThemeCSS,
revalidateThemeCache,
ServerThemeInjector,
} from '@kilivi/payloadcms-theme-management/server'
Always import server-only helpers from /server.
@kilivi-devThe API is unchanged. Only the package name differs.
Swap the dependency:
pnpm remove @kilivi-dev/payloadcms-theme-management
pnpm add @kilivi/payloadcms-theme-management
Replace the import prefix in your code: @kilivi-dev/payloadcms-theme-management → @kilivi/payloadcms-theme-management. This covers /server, /components/* and /fields/*.
Regenerate the admin import map so Payload resolves the admin components under the new name:
pnpm payload generate:importmap
If you list the package in next.config under transpilePackages, rename it there too.
Stored data does not need a migration: field names and database columns stay the same.
PREVIEW_SECRET and enable livePreview.injectRoute.tenantField and tenantQueryParam to keep preview URLs tenant-aware..claude/skills/.MIT
payload theme studio
Admin-only studio to restyle the Payload admin panel with colours, fonts, branding and custom CSS
301v3
payload theme
shadcn-style redesign of the Payload admin with dashboard, command palette, dark mode and live theme customizer
751.8k/wk36v3
theme
Admin UI theme for Payload v4 with three styles and four palettes in light and dark
74343/wk10v4
payload plugin color theory
Build site and admin themes from color harmonies with WCAG contrast checks and an Auto, Light and Dark switch
74134/wk0v3
styles
Manage UnoCSS design sets, shortcuts and design tokens from the Payload admin to generate site and admin CSS
6033/wk37v3
payload admin theme
shadcn-style admin theme for Payload configured from a global in the admin panel without rebuilds
5324/wk2v3