liderbektas

payload theme

by liderbektas
payload-theme
Admin customization
v3
^3.0.0
MIT

Overview

Summary generated from the README

Restyles the Payload admin panel from a single accent color using an OKLCH color scale. It is added as a plugin entry plus one stylesheet import, then the import map is regenerated. It adds a stats dashboard, a command palette, a grouped sidebar, a custom login screen and eight built-in languages. Requires Payload 3.

Features

  • Single accent color generates a full light and dark color scale with automatic contrast
  • Dashboard with per-collection stat cards, 30-day sparklines, trend chips and custom widgets
  • Command palette with recent documents, cross-collection search and quick create
  • Live theme customizer with presets, radius, font, neutral, density and a copy-config option
  • Grouped icon sidebar, branded split-screen login and sticky document outline
  • Interface strings translated in eight languages that follow the panel language

Use cases

  • Give clients a branded, polished admin panel without forking components
  • Add custom dashboard widgets showing collection statistics to the admin home
  • Let editors tune the look of the admin and export the result as plugin config

From the author

A shadcn-style theme for the Payload CMS admin panel — dashboard with sparklines, ⌘K command palette, grouped icon sidebar, live theme customizer, dark mode, 8 languages. One accent color, two lines of setup.

Installation

npm i payload-theme

36

Stars

7

Forks

17

Open Issues

1 weeks ago

Last Updated

1.8k

Weekly Downloads

v0.11.0

npm Version

545.4 KB

Unpacked Size

1

Dependencies

GitHub stars

36+17 since Sep 6

Show data
GitHub stars by day (UTC)
DateStars
Dec 5, 202636
Dec 4, 202636
Dec 3, 202636
Dec 2, 202636
Dec 1, 202636
Nov 30, 202636
Nov 29, 202636
Nov 28, 202636
Nov 27, 202636
Nov 26, 202634
Nov 25, 202634
Nov 24, 202634
Nov 23, 202634
Nov 22, 202634
Nov 21, 202634
Nov 20, 202634
Nov 19, 202634
Nov 18, 202634
Nov 17, 202633
Nov 16, 202633
Nov 15, 202632
Nov 14, 202631
Nov 13, 202631
Nov 12, 202629
Nov 11, 202629
Nov 10, 202628
Nov 9, 202627
Nov 8, 202627
Nov 7, 202627
Nov 6, 202627
Nov 5, 202627
Nov 4, 202627
Nov 3, 202627
Nov 2, 202627
Nov 1, 202627
Oct 31, 202627
Oct 30, 202626
Oct 29, 202626
Oct 28, 202626
Oct 27, 202626
Oct 26, 202626
Oct 25, 202626
Oct 24, 202626
Oct 23, 202626
Oct 22, 202626
Oct 21, 202625
Oct 20, 202625
Oct 19, 202625
Oct 18, 202625
Oct 17, 202625
Oct 16, 202625
Oct 15, 202625
Oct 14, 202625
Oct 13, 202625
Oct 12, 202625
Oct 11, 202625
Oct 10, 202625
Oct 9, 202624
Oct 8, 202624
Oct 7, 202624
Oct 6, 202624
Oct 5, 202624
Oct 4, 202624
Oct 3, 202624
Oct 2, 202623
Oct 1, 202623
Sep 30, 202623
Sep 29, 202623
Sep 28, 202623
Sep 27, 202623
Sep 26, 202623
Sep 25, 202623
Sep 24, 202623
Sep 23, 202623
Sep 22, 202623
Sep 21, 202623
Sep 20, 202623
Sep 19, 202623
Sep 18, 202623
Sep 17, 202622
Sep 16, 202621
Sep 15, 202621
Sep 14, 202621
Sep 13, 202620
Sep 12, 202620
Sep 11, 202620
Sep 10, 202619
Sep 9, 202619
Sep 8, 202619
Sep 7, 202619
Sep 6, 202619
npm weekly downloads

1.8K+1.3K since Sep 6

Show data
npm weekly downloads by day (UTC)
DateWeekly downloads
Dec 5, 20261,786
Dec 4, 20261,792
Dec 3, 20261,706
Dec 2, 20261,585
Dec 1, 20261,644
Nov 30, 20261,399
Nov 29, 20261,230
Nov 28, 20261,210
Nov 27, 20261,250
Nov 26, 20261,371
Nov 25, 20261,393
Nov 24, 20261,297
Nov 23, 20261,292
Nov 22, 20261,489
Nov 21, 20261,503
Nov 20, 20261,501
Nov 19, 20261,391
Nov 18, 20261,484
Nov 17, 20261,483
Nov 16, 20261,468
Nov 15, 20261,316
Nov 14, 20261,342
Nov 13, 20261,464
Nov 12, 20261,457
Nov 11, 20261,309
Nov 10, 20261,310
Nov 9, 20261,752
Nov 8, 20261,909
Nov 7, 20262,064
Nov 6, 20262,090
Nov 5, 20262,197
Nov 4, 20262,410
Nov 3, 20262,410
Nov 2, 20262,014
Nov 1, 20262,415
Oct 31, 20262,306
Oct 30, 20262,307
Oct 29, 20261,975
Oct 28, 20261,624
Oct 27, 20261,918
Oct 26, 20261,913
Oct 25, 20261,395
Oct 24, 20261,327
Oct 23, 2026953
Oct 22, 20261,175
Oct 21, 20261,349
Oct 20, 20261,053
Oct 19, 20261,152
Oct 18, 20261,204
Oct 17, 20261,162
Oct 16, 20261,343
Oct 15, 20261,320
Oct 14, 20261,343
Oct 13, 20261,335
Oct 12, 20261,211
Oct 11, 20261,115
Oct 10, 20261,090
Oct 9, 20261,110
Oct 8, 20261,343
Oct 7, 20261,786
Oct 6, 20261,915
Oct 5, 20261,888
Oct 4, 20261,840
Oct 3, 20261,742
Oct 2, 20261,616
Oct 1, 20261,322
Sep 30, 2026793
Sep 29, 2026692
Sep 28, 2026731
Sep 27, 2026732
Sep 26, 2026764
Sep 25, 2026843
Sep 24, 2026902
Sep 23, 2026990
Sep 22, 2026934
Sep 21, 2026863
Sep 20, 20261,013
Sep 19, 20261,004
Sep 18, 20261,075
Sep 17, 20261,073
Sep 16, 20261,011
Sep 15, 20261,024
Sep 14, 20261,176
Sep 13, 20261,086
Sep 12, 20261,059
Sep 11, 2026875
Sep 10, 2026781
Sep 9, 2026710
Sep 8, 2026745
Sep 7, 2026597
Sep 6, 2026510

Each point is npm's rolling 7-day download count.

Health Score

75/100Excellent

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/1296456147-payload-theme.svg)](https://payloaddirectory.dev/plugins/1296456147-payload-theme)
HTML
<a href="https://payloaddirectory.dev/plugins/1296456147-payload-theme"><img src="https://payloaddirectory.dev/badge/1296456147-payload-theme.svg" alt="Payload Directory"></a>
Updated Nov 26, 2026Created Jul 10, 2026Published Nov 13, 2026

README

payload-theme

Make your Payload admin panel look custom-built — in 2 lines.

One accent color in, a complete shadcn-style redesign out: dashboard with sparklines and 30-day trends, ⌘K command palette with recents, grouped icon sidebar, split-screen login, sticky document outlines, and a live theme customizer with one-click presets, five typefaces and a copy-paste config generator — light and dark, in eight languages.

CI npm npm downloads Payload 3 license: MIT

Quickstart · Tour · Try the demo · Options


payload-theme dashboard

The same panel, one plugin later. Every pixel above ships in this package.


Why

Payload is the best headless CMS in the Node ecosystem — and its admin panel looks like a database UI. Clients notice. Editors notice. payload-theme turns the stock panel into something people screenshot, without forking a single component:

The same Payload dashboard before and after payload-theme

Same panel, same data — the only difference is one plugin.

  • 🎨 One accent color drives everything — an 11-step OKLCH scale recolors buttons, focus rings, nav, sparklines, the login glow. Automatic WCAG contrast included.
  • 🧱 No forked components, no config surgery — a plugin entry and a CSS import. Remove both lines and you're back to stock.
  • 🌗 Dark mode designed, not inverted — every surface sits on a zinc ladder; dark gets its own remapped scale.
  • ⚡ Zero runtime cost — color math runs once at startup and lands as CSS custom properties. SSR-safe, no FOUC.
  • 📱 A real phone experience — a sliding drawer over a blurred scrim, wrapping bulk actions, aligned cards. Editors approve from the couch.
  • 🌍 Not half-English — every string the theme adds is translated in eight languages and follows the panel language your editors picked.

Installation

pnpm add payload-theme
# or: npm i payload-theme / yarn add payload-theme

Line 1 — add the plugin to payload.config.ts:

import { payloadTheme } from 'payload-theme'

export default buildConfig({
  plugins: [
    payloadTheme({ accent: '#0d9488' }),
  ],
})

Line 2 — import the stylesheet in src/app/(payload)/custom.scss (every create-payload-app project already has this file):

@import 'payload-theme/styles.css';

Then regenerate the import map and restart:

npx payload generate:importmap

Open the admin panel. That's the whole migration. 🎉


The tour

A login screen people screenshot

A split card: a permanently-dark brand panel whose glow is painted from your accent, your logo, your copy (login.heading / login.tagline) — and the form beside it.

Login

A dashboard that's actually a dashboard

The default dashboard becomes a widget grid: one stat card per collection with an animated count, a 30-day creation sparkline and a trend chip (+12%, -8% — this month's created docs vs the month before), cards for your globals, and — if you want — your own React widgets below it (docs). Server-rendered through Payload's local API: access control applies, no loading flash.

Dashboard

A sidebar that reads like a product

Your logo on top, a ⌘K search pill, grouped collections with lucide icons (admin.group + nav.icons), an accent pill on the active item, and a shadcn-style user block pinned to the bottom — avatar, name, email, and a popup with Account, the locale switcher and Log out. When collections overflow, only the menu scrolls; logo, search and the user block stay put. On desktop, a panel toggle at the header's left collapses the whole sidebar with a smooth grid animation — full-width content one click away.

⌘K command palette

Press ⌘K / Ctrl+K anywhere: your five most recent documents wait at the top, jump to any collection or global, search documents across collections as you type, create a new document in any collection, switch light/dark, or log out. Ships inside the theme — zero extra dependencies. And press ? anywhere for the keyboard-shortcuts cheatsheet.

Command palette

A live theme customizer in the header

The palette button opens a panel where anyone can restyle the panel at runtime — no rebuild, no deploy:

  • Presets — six one-click full themes (Zinc, Ocean, Forest, Sunset, Berry, Swiss), each a coherent accent + radius + typeface + neutral identity. The same six are config values, so a look you like here is preset: 'ocean' in your payload.config.ts — and Copy config writes exactly that one line when the panel matches a preset
  • Accent — 10 curated swatches + a free hex field, recoloring the entire panel live through the same OKLCH engine
  • Radius — the whole 'none' → 'full' scale
  • Font — Inter, Geist, Helvetica or the system stack, each button previewing its own face
  • Neutral — the gray family behind every surface: Zinc, Slate (cool), Gray, Neutral (pure) or Stone (warm)
  • Density — comfortable or compact: tighter inputs, buttons, table rows and form grid for data-heavy panels
  • Frame — inset (content floats in a rounded card) or flat (edge to edge, one hairline against the sidebar)
  • Color mode — light/dark, stored in the same preference Payload's Account page uses
  • Dark mode depth — deep (near-black) or dim (every surface a rung lighter, softer at night)
  • Content layout — centered (~1280px) or full width

Everything persists in the browser; Reset returns to your config — and Copy config turns whatever is on screen into a ready-to-paste payloadTheme({ ... }) snippet, so the customizer doubles as your config generator.

Theme customizer

It speaks your panel's language

If your panel isn't in English, the theme isn't either. Every string it adds — the sidebar's search pill, the palette and its groups, the dashboard captions and trend tooltips, "On this page", the customizer's own labels, the login copy — ships translated in English, German, French, Spanish, Italian, Dutch, Portuguese and Turkish, and follows whatever language the user picked on their Account page.

Nothing to configure: the plugin merges a payloadTheme:* namespace into config.i18n.translations for every language Payload accepts. A language without a translation yet falls back to English rather than leaking raw keys, and anything you declare under that namespace yourself wins — which is also the supported way to reword the theme without touching a component:

i18n: {
  supportedLanguages: { de, en },
  translations: {
    de: { payloadTheme: { onThisPage: 'Inhaltsverzeichnis' } },
  },
},

Payload's admin panel is English-only until you list languages in i18n.supportedLanguages — that's a Payload default, not a theme one. The theme simply follows whatever you set there.

Missing your language? It's one file — copy en.ts, translate the values, add one line to index.ts. PRs very welcome.

A document outline that follows your scroll

Long edit forms get a sticky "On this page" rail pinned to the right edge of wide viewports: quiet tick bars at rest, a labeled panel on hover. Entries are the form's top-level sections — groups, collapsibles, blocks, arrays, and every tab of a tabs field. Click to scroll (or switch tab); the active section tracks as you read. Renders only when a document has 3+ sections, and never on small screens.

Document outline

Blocks that read like a page outline

Structured content stops looking like stock Payload. Block and array rows render as one unified list — hairline-divided entries with a muted row number, a per-block-type icon, the block title, and quiet ghost actions. The theme ships icons for common slugs (content, cta, hero); any project block opts in with one CSS custom property:

.blocks-field__block-pill-gallery {
  --pt-block-ico: url("data:image/svg+xml,..."); /* any 24×24 stroke SVG */
}

Adding rows is one consistent gesture everywhere — a full-width dashed bar that lights up in the accent on hover. The block-picker drawer shows shadcn-style cards.

Blocks list with per-type icons

Edit views: a real form layout, not a field pile

One content card with a two-column field grid: compact fields pair up (Title | Slug), wide surfaces keep the full row, everything stacks below 1024px. Inputs follow the shadcn language (thin borders, accent focus ring), checkboxes render as toggles, top-level groups sit in raised panels, and the sticky action bar — icons on every action — blurs the content scrolling underneath.

Edit view

Tabs, radio groups, JSON, code editors, date pickers, multi-selects, relationship fields — all themed:

Tabs and field types

List views & a real media library

Tables become clean cards under a single-row toolbar — search, Columns/Filters pills and a solid + Create New on one line. Status and boolean values render as always-round neutral badges, and empty collections get an illustrated empty state.

List view Media grid

Actually responsive — not just "it fits"

On the phone the panel becomes a product of its own: the sidebar turns into a ~300px drawer sliding over a blurred scrim (tap the scrim to close — no clumsy ✕), the toggler wears the same panel mark as desktop, bulk actions wrap into tidy chip rows, stat cards stack, and edit views keep the exact same card language.

Mobile drawer Mobile list view Mobile edit view, dark

Dark mode, for free

Every surface, badge, card and glow is token-driven. Nested surfaces get lighter as they stack (never darker "wells"), fields inside raised panels sit flat with their borders doing the work, and the accent is remapped so it stays vivid on dark.

Dark edit view

🚀 Try it in 60 seconds

The repo ships a full demo panel — six collections, every field type, block-built pages, a seeded media library:

git clone https://github.com/liderbektas/payload-theme
cd payload-theme && pnpm install && pnpm build
cp dev/.env.example dev/.env
pnpm seed && pnpm dev

Open http://localhost:3000/admin and log in:

UserPasswordRole
[email protected]test1234Admin
[email protected]test1234Editor

Play with the header's theme customizer — accent, radius, color mode and layout all apply live. The panel ships with four languages enabled, so the Account page's language switcher shows the theme following along.


Options

Everything is optional. This is the full surface:

payloadTheme({
  // A whole look in one word — accent + radius + typeface + neutral together:
  // 'zinc' | 'ocean' | 'forest' | 'sunset' | 'berry' | 'swiss'.
  // The same six the header customizer offers. Anything you also set
  // explicitly below wins over the preset.
  preset: 'ocean',

  // The one color that drives everything: buttons, active nav pill,
  // focus rings, selected rows, sparklines, the login glow... Any hex works.
  accent: '#e30613',

  // Corner rounding for the WHOLE panel: 'none' | 'sm' | 'md' | 'lg' | 'full'.
  radius: 'md',

  // Panel typeface: 'inter' | 'geist' (Google Fonts, loaded at runtime),
  // 'helvetica' | 'system' (pure font stacks, no network) — or any custom
  // CSS font-family stack (self-host the @font-face yourself).
  font: 'inter',

  // The gray family behind surfaces, borders and text:
  // 'zinc' | 'slate' | 'gray' | 'neutral' | 'stone'.
  neutral: 'slate',

  // Spacing: 'comfortable' | 'compact' (tighter controls, rows and grid).
  density: 'compact',

  // Content frame: 'inset' (rounded card on the gray field) | 'flat'.
  frame: 'inset',

  // Dark mode depth: 'deep' (near-black) | 'dim' (one rung softer).
  darkMode: 'dim',

  // Your logo — top of the sidebar AND above the login form.
  // A URL, or { light, dark } to swap artwork per color scheme.
  logo: { light: '/logo.svg', dark: '/logo-dark.svg' },

  // Rendered height of the logo: a number in px, or any CSS length.
  logoHeight: 28,

  // Small mark, used as a fallback for the login logo.
  icon: '/mark.svg',

  // The user avatar in the sidebar/header user block. Omit it and the theme
  // honors Payload's own `admin.avatar` (gravatar or a custom Component),
  // falling back to the accent initials circle.
  //   'initials' | 'gravatar' | { field, size }
  avatar: { field: 'avatar' },

  // Copy on the login brand panel.
  login: {
    heading: 'Welcome back',
    tagline: 'Sign in to manage your content.',
  },

  // Sidebar + dashboard + palette icons per collection/global slug —
  // any icon name from lucide.dev.
  nav: {
    icons: {
      posts: 'newspaper',
      media: 'image',
      users: 'users',
      settings: 'settings',
    },
  },

  // Your own React components below the built-in dashboard content.
  dashboard: {
    widgets: [
      '/components/widgets/StatisticsWidget#StatisticsWidget',
      { component: '/components/widgets/LastLoginWidget#LastLoginWidget', width: 'third' },
    ],
  },

  // Escape hatch: raw --pt-* token overrides, applied last.
  cssVariables: {
    '--pt-radius-card': '10px',
  },
})
OptionTypeDefaultWhat it does
preset'zinc' | 'ocean' | 'forest' | 'sunset' | 'berry' | 'swiss'—Sets accent, radius, font and neutral together as one coherent identity. Each option you pass explicitly overrides its part.
accentstring (hex)#4f4eceGenerates a full 50–950 color scale in OKLCH and colors every interactive element with it.
radius'none' | 'sm' | 'md' | 'lg' | 'full''md'Global corner rounding — buttons, inputs, badges, cards, tables, popovers and menu items all follow it.
font'inter' | 'geist' | 'helvetica' | 'system' | stringPayload's fontPanel typeface. inter/geist load from Google Fonts at runtime; helvetica/system are pure stacks; any other string is used as a custom font-family stack.
neutral'zinc' | 'slate' | 'gray' | 'neutral' | 'stone''zinc'The gray family behind every surface, border and text rung (Tailwind's neutral palettes), light and dark.
density'comfortable' | 'compact''comfortable'compact tightens input and button heights, table rows, the form grid and view padding.
frame'inset' | 'flat''inset'inset floats the content in a rounded, bordered card; flat runs it edge to edge with one divider against the sidebar.
darkMode'deep' | 'dim''deep'Dark-mode depth: deep puts the content on near-black, dim lifts every surface one rung.
logostring | { light, dark }Payload logoImage URL(s) shown at the top of the sidebar and above the login form.
logoHeightnumber | string26Rendered logo height — a number is px, a string is any CSS length.
iconstring | { light, dark }—Small mark, used as a login-logo fallback.
avatar'initials' | 'gravatar' | { field, size }Payload's admin.avatar, else initialsWhere the user avatar comes from — see User avatar.
login.headingstring'Welcome back'Big heading on the login brand panel.
login.taglinestring'Sign in to manage your content.'Supporting line under the heading.
nav.iconsRecord<slug, iconName>folder iconMaps collections/globals to lucide icons — sidebar, dashboard cards and palette.
dashboard.widgetsDashboardWidget[][]Custom components rendered below the built-in dashboard content.
cssVariablesRecord<string, string>—Escape hatch: override any raw --pt-* token directly.

User avatar

The user block at the bottom of the sidebar (and the compact chip in the header) draws an accent circle with the user's initials by default. Three other sources are one option away:

payloadTheme({
  // 1. A field on your auth collection — an upload/relationship to a media
  //    collection, or a plain text field holding a URL. Dot paths reach into
  //    groups ('profile.photo'); `size` picks a named upload size.
  avatar: { field: 'avatar', size: 'thumbnail' },

  // 2. The Gravatar registered to the user's email.
  avatar: 'gravatar',

  // 3. The initials circle, explicitly — keeps it even when `admin.avatar` is set.
  avatar: 'initials',
})

Add the field to your auth collection like any other:

export const Users: CollectionConfig = {
  slug: 'users',
  auth: true,
  fields: [{ name: 'avatar', type: 'upload', relationTo: 'media' }],
}

Payload's own admin.avatar works too. Leave the theme's avatar option out and whatever you set on the config decides — including a custom component:

export default buildConfig({
  admin: {
    // 'default' | 'gravatar' | { Component }
    avatar: { Component: '/components/MyAvatar#MyAvatar' },
  },
  plugins: [payloadTheme({ accent: '#e30613' })],
})

The component is rendered on the server (so it receives payload, user, i18n and permissions as props) and placed inside the theme's circle, which clips it and drops its accent fill. admin.avatar: 'default' means "Payload's default icon" — the theme reads that as its own default and keeps the initials.

Payload also renders admin.avatar.Component into its own header account button, which this theme hides — so a custom component mounts twice per page. Keep it side-effect-free (or use the theme's avatar option instead) if that matters to you.

Resolution happens once per request in a server provider, so an upload relationship is looked up with access control applied and never fetched in the browser. Anything unresolvable — no field value, a deleted upload, no read access — falls back to initials rather than breaking the page.

Dashboard widgets

The built-in dashboard always renders as-is — widgets are an additional area below it. Point each entry at a React component using Payload's standard import-map path convention:

payloadTheme({
  dashboard: {
    widgets: [
      // string form — 'half' width by default
      '/components/widgets/StatisticsWidget#StatisticsWidget',
      // object form — 'full' | 'half' | 'third'
      { component: '/components/widgets/LastLoginWidget#LastLoginWidget', width: 'third' },
    ],
  },
})

Server components receive the live Payload context as props:

import type { DashboardWidgetServerProps } from 'payload-theme'

export const StatisticsWidget: React.FC<DashboardWidgetServerProps> = async ({ payload, user }) => {
  const drafts = await payload.count({
    collection: 'posts',
    overrideAccess: false,
    user,
    where: { _status: { equals: 'draft' } },
  })
  return <article className="pt-dash__card">…{drafts.totalDocs}…</article>
}

Client components ('use client') receive no props — use Payload's hooks or the REST API. The plugin registers every widget in admin.dependencies, so payload generate:importmap picks them up automatically.

Reuse the theme's card classes (pt-dash__card, pt-dash__card-head, pt-dash__card-label, pt-dash__card-body, pt-dash__card-count, pt-dash__card-caption) if you want your widget to match the built-in stat cards.

Under the hood

  • One accent, everywhere — your hex becomes an 11-step OKLCH scale; every interactive element recolors consistently.
  • Smart dark mode — the scale is re-mapped for dark (brighter accent step, never a naive inversion).
  • Automatic contrast — text on the accent picks black or white by WCAG relative luminance.
  • Toggles, not checkboxes — pure CSS; form behavior and accessibility untouched.
  • Zero runtime color math — computed once at startup, injected as CSS custom properties. No FOUC, SSR-safe.
  • Non-destructive — everything ships in @layer payload, overriding Payload's defaults without specificity wars or !important.
  • Zinc foundation — Payload's neutral scale is retargeted to the shadcn zinc ladder, light and dark.
  • Icons via CSS masks — glyphs are currentColor masks; they recolor with every state, accent and scheme.
  • Runtime restyling — the customizer recomputes the accent scale client-side with the same engine the server uses.

Fine-tuning with CSS variables

Every token is a plain CSS custom property:

payloadTheme({
  accent: '#0ea5e9',
  cssVariables: {
    '--pt-accent-subtle': 'oklch(0.95 0.03 240)',
  },
})

The important ones: --pt-accent-50 … --pt-accent-950, --pt-accent, --pt-accent-hover, --pt-accent-active, --pt-accent-subtle, --pt-accent-contrast, --pt-accent-ring, plus the radius tokens --pt-radius-ctl, --pt-radius-card, --pt-radius-item, the status colors --pt-ok / --pt-warn / --pt-danger / --pt-info (each with a -text variant), the type scale --pt-text-3xs … --pt-text-3xl, the density tokens --pt-ctl-h, --pt-cell-py, --pt-field-gap, --pt-section-gap, the frame tokens --pt-frame-inset, --pt-frame-radius, --pt-frame-shadow, the list table's height cap --pt-table-max-h, and the per-block icon hook --pt-block-ico.

What it touches

No component is forked and no file of yours is rewritten: the plugin adds keys to your Payload config and restyles the markup Payload already renders. This is the complete surface — worth a read before you layer your own customizations on top, and the first place to look when a Payload upgrade changes something.

Config keys the plugin sets (src/index.ts):

KeyEffectWhat it is
admin.components.NavreplacesThe grouped icon sidebar, ⌘K pill and user block.
admin.components.views.dashboard.ComponentreplacesThe stat-card dashboard.
admin.components.providersadds 4BootScript (replays the header customizer's overrides before the first paint), AvatarProvider (resolves the user avatar server-side), ThemeProvider (injects the --pt-* tokens) and ListQuickActions (row-hover edit/delete).
admin.components.actionsadds 1HeaderActions — customizer, light/dark toggle, user menu.
admin.components.beforeLoginadds 1LoginHero — the brand panel. The split login layout only applies when it renders.
admin.custom.payloadThemeadds 1The resolved theme config the client components read.
admin.dependenciesadds 1 per widgetSo generate:importmap finds your dashboard.widgets.
i18n.translationsadds 1 namespace per languageThe theme's own payloadTheme:* strings. Your keys are preserved and win; supportedLanguages and fallbackLanguage are untouched.
admin.components.beforeListTable (upload collections)adds 1The grid/table toggle above media lists.
checkbox fields' admin.components.Celladds, only when unsetBoolean columns render as Yes/No chips instead of true/false.

The two replacements are the only conflicts. If your project already sets a custom Nav or its own dashboard view, the theme overwrites it — plugins run in array order, so re-assign yours in a small transform after payloadTheme() and it wins:

plugins: [
  payloadTheme({ accent: '#0d9488' }),
  (config) => ({
    ...config,
    admin: { ...config.admin, components: { ...config.admin?.components, Nav: '/components/MyNav#MyNav' } },
  }),
]

Everything else is additive and order-preserving: your components stay, the theme's are appended after them.

Nothing else is read or written. Collections, fields, hooks, access control, endpoints and your data are untouched, and removing the plugin entry plus the CSS import returns you to a stock panel with no migration.

Styles. The whole stylesheet lives in @layer payload, which Payload pre-declares after its own payload-default layer — so the theme wins without !important and your own unlayered CSS still beats the theme. The exceptions are a handful of rules that must be unlayered because the Payload/third-party stylesheets they override are (empty-list results, thumbnail sizing, react-datepicker, toasts); they are isolated in one file, styles/overrides/unlayered.css.

On a Payload upgrade. Two kinds of coupling can drift:

  • Class names. The stylesheet targets Payload's own BEM classes (.document-fields__fields, .blocks-field__rows, .collection-list .table, …). If Payload renames one, the affected rules simply stop applying — stock styling shows through in that one spot. Nothing throws, nothing breaks functionally.
  • Rendered DOM. Three enhancements work off the rendered markup rather than a schema: the row actions column (injected into list tables), the document outline (scans the edit form), and the media grid (a CSS reflow of the upload list table). All three fail soft — no column, no rail, a plain table — rather than erroring.

Everything else rides on public API (@payloadcms/ui hooks, the local API, REST routes from config.routes), so a breaking change there surfaces at build time instead of silently. The package is developed against the Payload version listed under Requirements and each release is verified with a screenshot-regression suite across the whole panel; if a newer Payload shifts something before an update ships, open an issue — a class-name fix is usually a one-line patch. Maintainers: the full coupling map and upgrade checklist live in CONTRIBUTING.md.

Requirements

  • Payload 3.x (peer range ^3.0.0; developed and e2e-tested against 3.85)
  • Next.js 15+, React 19

Troubleshooting

"Component not found in import map" — run npx payload generate:importmap after installing, then restart the dev server.

Avatar still showing initials — the avatar resolver is a registered component, so run npx payload generate:importmap and restart after upgrading. Then check the source: avatar: { field } needs a value on that user's document, and avatar: 'initials' (or admin.avatar: 'default') deliberately keeps the initials.

Styles not applying — make sure @import 'payload-theme/styles.css'; is in src/app/(payload)/custom.scss.

Theme changes not showing in dev — Turbopack caches aggressively; delete your app's .next folder and restart.

Invalid accent color: '…' — the accent must be a hex string like #7c3aed.

Cannot assign to read only property 'i18n' of object in next dev (sometimes Cannot read properties of undefined (reading 'time') / 'stack') — a Next 16 dev-only race, not a theme bug: React's debug info (every server component's props, which Payload fills with i18n, req, payload …) streams over a separate websocket, and reloading while it is still resolving throws. Production builds never send it. Turn the separate channel off in next.config:

const nextConfig = {
  experimental: { reactDebugChannel: false },
}

License

MIT © Lider Bektaş

Found a bug or want a feature? Issues and PRs welcome.


Development (this monorepo)

packages/payload-theme   the plugin (published to npm)
dev                      a Payload 3 playground app that consumes it
docs                     README screenshots
pnpm install
pnpm build          # build the plugin
pnpm seed           # seed the playground with demo content
pnpm dev            # start the playground at http://localhost:3000/admin
pnpm test           # unit + integration tests
pnpm lint           # eslint across the repo
pnpm --filter dev test:e2e     # Playwright against the real admin panel
pnpm --filter dev test:visual  # screenshot regression suite

See CONTRIBUTING.md for the full guide and CHANGELOG.md for history.

Similar plugins