Adds an icon picker field to Payload 3 that stores the provider and icon name. Icons are discovered from the Lucide and Phosphor packages installed in your app and served as serialized SVGs from plugin endpoints, so provider modules stay out of client bundles. It requires Payload 3.37 or newer, React 19, and a Next.js config wrapper.
Icon picker field for Payload CMS with Lucide and Phosphor providers.
Installation
npm i payload-plugin-icons2
Stars
0
Forks
0
Open Issues
3 months ago
Last Updated
23
Weekly Downloads
v1.1.5
npm Version
170.7 KB
Unpacked Size
0
Dependencies
20 since Sep 6
| Date | Stars |
|---|---|
| Dec 5, 2026 | 2 |
| Dec 4, 2026 | 2 |
| Dec 3, 2026 | 2 |
| Dec 2, 2026 | 2 |
| Dec 1, 2026 | 2 |
| Nov 30, 2026 | 2 |
| Nov 29, 2026 | 2 |
| Nov 28, 2026 | 2 |
| Nov 27, 2026 | 2 |
| Nov 26, 2026 | 2 |
| Nov 25, 2026 | 2 |
| Nov 24, 2026 | 2 |
| Nov 23, 2026 | 2 |
| Nov 22, 2026 | 2 |
| Nov 21, 2026 | 2 |
| Nov 20, 2026 | 2 |
| Nov 19, 2026 | 2 |
| Nov 18, 2026 | 2 |
| Nov 17, 2026 | 2 |
| Nov 16, 2026 | 2 |
| Nov 15, 2026 | 2 |
| Nov 14, 2026 | 2 |
| Nov 13, 2026 | 2 |
| Nov 12, 2026 | 2 |
| Nov 11, 2026 | 2 |
| Nov 10, 2026 | 2 |
| Nov 9, 2026 | 2 |
| Nov 8, 2026 | 2 |
| Nov 7, 2026 | 2 |
| Nov 6, 2026 | 2 |
| Nov 5, 2026 | 2 |
| Nov 4, 2026 | 2 |
| Nov 3, 2026 | 2 |
| Nov 2, 2026 | 2 |
| Nov 1, 2026 | 2 |
| Oct 31, 2026 | 2 |
| Oct 30, 2026 | 2 |
| Oct 29, 2026 | 2 |
| Oct 28, 2026 | 2 |
| Oct 27, 2026 | 2 |
| Oct 26, 2026 | 2 |
| Oct 25, 2026 | 2 |
| Oct 24, 2026 | 2 |
| Oct 23, 2026 | 2 |
| Oct 22, 2026 | 2 |
| Oct 21, 2026 | 2 |
| Oct 20, 2026 | 2 |
| Oct 19, 2026 | 2 |
| Oct 18, 2026 | 2 |
| Oct 17, 2026 | 2 |
| Oct 16, 2026 | 2 |
| Oct 15, 2026 | 2 |
| Oct 14, 2026 | 2 |
| Oct 13, 2026 | 2 |
| Oct 12, 2026 | 2 |
| Oct 11, 2026 | 2 |
| Oct 10, 2026 | 2 |
| Oct 9, 2026 | 2 |
| Oct 8, 2026 | 2 |
| Oct 7, 2026 | 2 |
| Oct 6, 2026 | 2 |
| Oct 5, 2026 | 2 |
| Oct 4, 2026 | 2 |
| Oct 3, 2026 | 2 |
| Oct 2, 2026 | 2 |
| Oct 1, 2026 | 2 |
| Sep 30, 2026 | 2 |
| Sep 29, 2026 | 2 |
| Sep 28, 2026 | 2 |
| Sep 27, 2026 | 2 |
| Sep 26, 2026 | 2 |
| Sep 25, 2026 | 2 |
| Sep 24, 2026 | 2 |
| Sep 23, 2026 | 2 |
| Sep 22, 2026 | 2 |
| Sep 21, 2026 | 2 |
| Sep 20, 2026 | 2 |
| Sep 19, 2026 | 2 |
| Sep 18, 2026 | 2 |
| Sep 17, 2026 | 2 |
| Sep 16, 2026 | 2 |
| Sep 15, 2026 | 2 |
| Sep 14, 2026 | 2 |
| Sep 13, 2026 | 2 |
| Sep 12, 2026 | 2 |
| Sep 11, 2026 | 2 |
| Sep 10, 2026 | 2 |
| Sep 9, 2026 | 2 |
| Sep 8, 2026 | 2 |
| Sep 7, 2026 | 2 |
| Sep 6, 2026 | 2 |
3−14 since Sep 6
| Date | Weekly downloads |
|---|---|
| Dec 5, 2026 | 3 |
| Dec 4, 2026 | 3 |
| Dec 3, 2026 | 5 |
| Dec 2, 2026 | 11 |
| Dec 1, 2026 | 12 |
| Nov 30, 2026 | 12 |
| Nov 29, 2026 | 12 |
| Nov 28, 2026 | 13 |
| Nov 27, 2026 | 13 |
| Nov 26, 2026 | 13 |
| Nov 25, 2026 | 7 |
| Nov 24, 2026 | 6 |
| Nov 23, 2026 | 6 |
| Nov 22, 2026 | 7 |
| Nov 21, 2026 | 6 |
| Nov 20, 2026 | 7 |
| Nov 19, 2026 | 7 |
| Nov 18, 2026 | 7 |
| Nov 17, 2026 | 9 |
| Nov 16, 2026 | 10 |
| Nov 15, 2026 | 8 |
| Nov 14, 2026 | 8 |
| Nov 13, 2026 | 8 |
| Nov 12, 2026 | 15 |
| Nov 11, 2026 | 14 |
| Nov 10, 2026 | 12 |
| Nov 9, 2026 | 15 |
| Nov 8, 2026 | 16 |
| Nov 7, 2026 | 22 |
| Nov 6, 2026 | 20 |
| Nov 5, 2026 | 12 |
| Nov 4, 2026 | 12 |
| Nov 3, 2026 | 13 |
| Nov 2, 2026 | 12 |
| Nov 1, 2026 | 21 |
| Oct 31, 2026 | 16 |
| Oct 30, 2026 | 16 |
| Oct 29, 2026 | 15 |
| Oct 28, 2026 | 15 |
| Oct 27, 2026 | 15 |
| Oct 26, 2026 | 13 |
| Oct 25, 2026 | 4 |
| Oct 24, 2026 | 6 |
| Oct 23, 2026 | 6 |
| Oct 22, 2026 | 21 |
| Oct 21, 2026 | 22 |
| Oct 20, 2026 | 23 |
| Oct 19, 2026 | 23 |
| Oct 18, 2026 | 28 |
| Oct 17, 2026 | 26 |
| Oct 16, 2026 | 37 |
| Oct 15, 2026 | 30 |
| Oct 14, 2026 | 30 |
| Oct 13, 2026 | 29 |
| Oct 12, 2026 | 42 |
| Oct 11, 2026 | 37 |
| Oct 10, 2026 | 36 |
| Oct 9, 2026 | 27 |
| Oct 8, 2026 | 19 |
| Oct 7, 2026 | 18 |
| Oct 6, 2026 | 26 |
| Oct 5, 2026 | 12 |
| Oct 4, 2026 | 19 |
| Oct 3, 2026 | 19 |
| Oct 2, 2026 | 20 |
| Oct 1, 2026 | 20 |
| Sep 30, 2026 | 23 |
| Sep 29, 2026 | 15 |
| Sep 28, 2026 | 15 |
| Sep 27, 2026 | 9 |
| Sep 26, 2026 | 13 |
| Sep 25, 2026 | 12 |
| Sep 24, 2026 | 12 |
| Sep 23, 2026 | 11 |
| Sep 22, 2026 | 19 |
| Sep 21, 2026 | 20 |
| Sep 20, 2026 | 22 |
| Sep 19, 2026 | 24 |
| Sep 18, 2026 | 23 |
| Sep 17, 2026 | 26 |
| Sep 16, 2026 | 30 |
| Sep 15, 2026 | 22 |
| Sep 14, 2026 | 23 |
| Sep 13, 2026 | 20 |
| Sep 12, 2026 | 14 |
| Sep 11, 2026 | 14 |
| Sep 10, 2026 | 11 |
| Sep 9, 2026 | 8 |
| Sep 8, 2026 | 15 |
| Sep 7, 2026 | 18 |
| Sep 6, 2026 | 17 |
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/1197210288-root)<a href="https://payloaddirectory.dev/plugins/1197210288-root"><img src="https://payloaddirectory.dev/badge/1197210288-root.svg" alt="Payload Directory"></a>README
An icon picker field for Payload 3. It stores { provider, name }, discovers icons from the provider versions installed in your app, and renders provider-neutral serialized SVGs.
payload-plugin-icons is sponsored by BrainyBuilds. Thank you for supporting the project!
npm install payload-plugin-icons lucide-react @phosphor-icons/react
Requirements: Payload ^3.37.0, React 19, Lucide React >=0.400.0, and Phosphor React >=2.0.0.
import { buildConfig } from 'payload'
import { createIconPlugin } from 'payload-plugin-icons'
const { iconField, iconPlugin } = createIconPlugin()
export default buildConfig({
plugins: [iconPlugin],
collections: [
{
slug: 'pages',
fields: [
iconField({
name: 'icon',
label: 'Icon',
required: false,
}),
],
},
],
})
Configure next.config so provider packages are loaded natively only when an icon endpoint runs. (Lucide uses Node runtime loading because Next optimizes it by default; other providers are added to serverExternalPackages.)
import { withPayload } from '@payloadcms/next/withPayload'
import { withPayloadIcons } from 'payload-plugin-icons'
const nextConfig = {}
export default withPayload(
withPayloadIcons(nextConfig),
{ devBundleServerPackages: false },
)
Next.js output tracing cannot discover the provider packages because the plugin loads them through opaque runtime imports. This does not affect next dev or a conventional next start deployment where the project's complete node_modules remains available. However, output: 'standalone' copies only files discovered by output tracing into .next/standalone.
Explicitly include each configured provider package when building a standalone deployment:
import { withPayload } from '@payloadcms/next/withPayload'
import type { NextConfig } from 'next'
import { withPayloadIcons } from 'payload-plugin-icons'
const nextConfig: NextConfig = {
output: 'standalone',
outputFileTracingIncludes: {
'/*': [
'./node_modules/lucide-react/**/*',
'./node_modules/@phosphor-icons/react/**/*',
],
},
}
export default withPayload(
withPayloadIcons(nextConfig),
{ devBundleServerPackages: false },
)
If the plugin is configured with only one built-in provider, include only that provider's package. Add equivalent patterns for custom provider packages. Patterns are resolved from the Next.js project root; monorepos may also need Next.js's outputFileTracingRoot setting.
withPayloadIcons configures provider packages for native server loading, but opaque runtime imports still require these explicit tracing includes in standalone builds.
packageImport defaults to payload-plugin-icons. Set it when the package is exposed through a different monorepo alias:
createIconPlugin({ packageImport: '@acme/payload-icons' })
After changing the field configuration, regenerate Payload's import map and types:
payload generate:importmap
payload generate:types
Icon is a Client Component. It fetches a small serialized SVG definition from the plugin endpoint; provider packages stay on the server. Requests mounted in the same turn are automatically batched and definitions are shared in a module-level cache.
'use client'
import type { IconData } from 'payload-plugin-icons'
import { Icon } from 'payload-plugin-icons/client'
export function FeatureIcon({ icon }: { icon?: IconData | null }) {
return <Icon aria-hidden className="feature-icon" icon={icon} size={24} />
}
SVG props and event handlers are applied to the outer <svg>. Phosphor's weight is included in the request and cache key.
Use a subset of the built-in providers or change their labels:
import { createIconPlugin, lucideProvider } from 'payload-plugin-icons'
const { iconField, iconPlugin } = createIconPlugin({
providers: [lucideProvider({ label: 'Interface icons' })],
})
Field options:
name: stored field namelabel: admin labelrequired: require an icon namedefaultProviderId: provider selected for new documentsproviderIds: provider subset for this fieldlabelsById: field-specific provider labelspackageImport: field-specific package name or aliasadmin: additional Payload field admin optionsA custom provider implements the server-only IconProvider contract. Keep its package import inside loadCatalog / loadIcons, serialize only validated names from your catalog, and add the package name to withPayloadIcons.
import type { IconProvider } from 'payload-plugin-icons'
import { createIconPlugin, serializeIconComponent } from 'payload-plugin-icons'
const customProvider: IconProvider = {
id: 'custom',
label: 'Custom',
packageName: '@acme/icon-library',
async loadCatalog() {
return { provider: this.id, version: '1', icons: [{ name: 'Home' }] }
},
async loadIcons({ names }) {
const icons = await import('@acme/icon-library')
return Object.fromEntries(names.flatMap((name) =>
name === 'Home' ? [[name, serializeIconComponent(icons.Home)]] : [],
))
},
}
const { iconField, iconPlugin } = createIconPlugin({
providers: [customProvider],
})
Call withPayloadIcons(nextConfig, ['@acme/icon-library']) for this provider.
If /api/payload-icons/:provider/catalog or /api/payload-icons/:provider/icons works in development but returns 500 from a container that copies only .next/standalone, the provider package was probably omitted by Next.js output tracing. The endpoint may report that it is unable to load the icon catalog or icons.
Add the provider package to outputFileTracingIncludes as shown in Standalone and Docker deployments, rebuild the image, and confirm that its directory exists under the deployed node_modules. A typical standalone image copies .next/standalone and .next/static; copying .next/static does not add missing server dependencies.
npm ci
npm run dev
The development app uses a local SQLite database at dev/payload.db, so no external database is required. You can optionally copy dev/.env.example to dev/.env to set PAYLOAD_SECRET or override DATABASE_URL. The development admin runs at http://localhost:2515.
Useful commands:
npm run check: lint and create a clean package buildnpm run generate:importmap: regenerate the development import mapnpm run generate:types: regenerate development Payload typesnpm run build:next: build the development applicationdist is committed and verified in CI.
MIT
icons
Manage SVG icons as CMS content with icon sets, an admin select widget and a server Icon component
5732/wk37v3
payload plugin json form builder
Edit a Payload json field as real admin fields, with the form shape built in the admin panel
72441/wk37v3
payload icon picker
Icon picker field for Payload v4 that stores the icon name and raw SVG, with dropdown or drawer modes
7027/wk0v4
link field
Link field and Lexical link feature supporting internal document and custom URL links
6346/wk0v4
payload icon picker
Icon picker field for the Payload admin with adapters for Lucide, Tabler, Heroicons, Phosphor and more
53243/wk1v3
payload field validators
Validation helper functions for Payload collection fields with custom messages and common format checks
4025/wk4v3