Adds an iconField() helper that creates a text field rendered as a searchable icon picker in the admin UI. Icons are registered once in the plugin config through adapters for popular React icon libraries, and the selected icon is stored as a string. A client renderer and resolver turn stored values back into icons on the frontend.
Payload plugin introducing an icon picker into the CMS.
Installation
npm i @mvriu5/payload-icon-picker1
Stars
0
Forks
6
Open Issues
3 weeks ago
Last Updated
243
Weekly Downloads
v1.1.1
npm Version
65.3 KB
Unpacked Size
1
Dependencies
1+1 since Sep 7
| Date | Stars |
|---|---|
| Dec 6, 2026 | 1 |
| Dec 5, 2026 | 0 |
| Dec 4, 2026 | 0 |
| Dec 3, 2026 | 0 |
| Dec 2, 2026 | 0 |
| Dec 1, 2026 | 0 |
| Nov 30, 2026 | 0 |
| Nov 29, 2026 | 0 |
| Nov 28, 2026 | 0 |
| Nov 27, 2026 | 0 |
| Nov 26, 2026 | 0 |
| Nov 25, 2026 | 0 |
| Nov 24, 2026 | 0 |
| Nov 23, 2026 | 0 |
| Nov 22, 2026 | 0 |
| Nov 21, 2026 | 0 |
| Nov 20, 2026 | 0 |
| Nov 19, 2026 | 0 |
| Nov 18, 2026 | 0 |
| Nov 17, 2026 | 0 |
| Nov 16, 2026 | 0 |
| Nov 15, 2026 | 0 |
| Nov 14, 2026 | 0 |
| Nov 13, 2026 | 0 |
| Nov 12, 2026 | 0 |
| Nov 11, 2026 | 0 |
| Nov 10, 2026 | 0 |
| Nov 9, 2026 | 0 |
| Nov 8, 2026 | 0 |
| Nov 7, 2026 | 0 |
| Nov 6, 2026 | 0 |
| Nov 5, 2026 | 0 |
| Nov 4, 2026 | 0 |
| Nov 3, 2026 | 0 |
| Nov 2, 2026 | 0 |
| Nov 1, 2026 | 0 |
| Oct 31, 2026 | 0 |
| Oct 30, 2026 | 0 |
| Oct 29, 2026 | 0 |
| Oct 28, 2026 | 0 |
| Oct 27, 2026 | 0 |
| Oct 26, 2026 | 0 |
| Oct 25, 2026 | 0 |
| Oct 24, 2026 | 0 |
| Oct 23, 2026 | 0 |
| Oct 22, 2026 | 0 |
| Oct 21, 2026 | 0 |
| Oct 20, 2026 | 0 |
| Oct 19, 2026 | 0 |
| Oct 18, 2026 | 0 |
| Oct 17, 2026 | 0 |
| Oct 16, 2026 | 0 |
| Oct 15, 2026 | 0 |
| Oct 14, 2026 | 0 |
| Oct 13, 2026 | 0 |
| Oct 12, 2026 | 0 |
| Oct 11, 2026 | 0 |
| Oct 10, 2026 | 0 |
| Oct 9, 2026 | 0 |
| Oct 8, 2026 | 0 |
| Oct 7, 2026 | 0 |
| Oct 6, 2026 | 0 |
| Oct 5, 2026 | 0 |
| Oct 4, 2026 | 0 |
| Oct 3, 2026 | 0 |
| Oct 2, 2026 | 0 |
| Oct 1, 2026 | 0 |
| Sep 30, 2026 | 0 |
| Sep 29, 2026 | 0 |
| Sep 28, 2026 | 0 |
| Sep 27, 2026 | 0 |
| Sep 26, 2026 | 0 |
| Sep 25, 2026 | 0 |
| Sep 24, 2026 | 0 |
| Sep 23, 2026 | 0 |
| Sep 22, 2026 | 0 |
| Sep 21, 2026 | 0 |
| Sep 20, 2026 | 0 |
| Sep 19, 2026 | 0 |
| Sep 18, 2026 | 0 |
| Sep 17, 2026 | 0 |
| Sep 16, 2026 | 0 |
| Sep 15, 2026 | 0 |
| Sep 14, 2026 | 0 |
| Sep 13, 2026 | 0 |
| Sep 12, 2026 | 0 |
| Sep 11, 2026 | 0 |
| Sep 10, 2026 | 0 |
| Sep 9, 2026 | 0 |
| Sep 8, 2026 | 0 |
| Sep 7, 2026 | 0 |
234+177 since Sep 7
| Date | Weekly downloads |
|---|---|
| Dec 6, 2026 | 234 |
| Dec 5, 2026 | 218 |
| Dec 4, 2026 | 167 |
| Dec 3, 2026 | 118 |
| Dec 2, 2026 | 54 |
| Dec 1, 2026 | 120 |
| Nov 30, 2026 | 133 |
| Nov 29, 2026 | 127 |
| Nov 28, 2026 | 119 |
| Nov 27, 2026 | 106 |
| Nov 26, 2026 | 108 |
| Nov 25, 2026 | 101 |
| Nov 24, 2026 | 34 |
| Nov 23, 2026 | 56 |
| Nov 22, 2026 | 56 |
| Nov 21, 2026 | 58 |
| Nov 20, 2026 | 62 |
| Nov 19, 2026 | 61 |
| Nov 18, 2026 | 73 |
| Nov 17, 2026 | 76 |
| Nov 16, 2026 | 61 |
| Nov 15, 2026 | 112 |
| Nov 14, 2026 | 126 |
| Nov 13, 2026 | 123 |
| Nov 12, 2026 | 121 |
| Nov 11, 2026 | 110 |
| Nov 10, 2026 | 118 |
| Nov 9, 2026 | 97 |
| Nov 8, 2026 | 56 |
| Nov 7, 2026 | 43 |
| Nov 6, 2026 | 45 |
| Nov 5, 2026 | 59 |
| Nov 4, 2026 | 57 |
| Nov 3, 2026 | 52 |
| Nov 2, 2026 | 56 |
| Nov 1, 2026 | 42 |
| Oct 31, 2026 | 37 |
| Oct 30, 2026 | 41 |
| Oct 29, 2026 | 25 |
| Oct 28, 2026 | 22 |
| Oct 27, 2026 | 19 |
| Oct 26, 2026 | 18 |
| Oct 25, 2026 | 23 |
| Oct 24, 2026 | 31 |
| Oct 23, 2026 | 24 |
| Oct 22, 2026 | 39 |
| Oct 21, 2026 | 44 |
| Oct 20, 2026 | 41 |
| Oct 19, 2026 | 41 |
| Oct 18, 2026 | 76 |
| Oct 17, 2026 | 68 |
| Oct 16, 2026 | 79 |
| Oct 15, 2026 | 88 |
| Oct 14, 2026 | 104 |
| Oct 13, 2026 | 138 |
| Oct 12, 2026 | 132 |
| Oct 11, 2026 | 105 |
| Oct 10, 2026 | 137 |
| Oct 9, 2026 | 136 |
| Oct 8, 2026 | 112 |
| Oct 7, 2026 | 92 |
| Oct 6, 2026 | 57 |
| Oct 5, 2026 | 73 |
| Oct 4, 2026 | 65 |
| Oct 3, 2026 | 51 |
| Oct 2, 2026 | 49 |
| Oct 1, 2026 | 53 |
| Sep 30, 2026 | 55 |
| Sep 29, 2026 | 60 |
| Sep 28, 2026 | 55 |
| Sep 27, 2026 | 57 |
| Sep 26, 2026 | 55 |
| Sep 25, 2026 | 54 |
| Sep 24, 2026 | 57 |
| Sep 23, 2026 | 60 |
| Sep 22, 2026 | 63 |
| Sep 21, 2026 | 71 |
| Sep 20, 2026 | 68 |
| Sep 19, 2026 | 63 |
| Sep 18, 2026 | 72 |
| Sep 17, 2026 | 72 |
| Sep 16, 2026 | 70 |
| Sep 15, 2026 | 68 |
| Sep 14, 2026 | 49 |
| Sep 13, 2026 | 54 |
| Sep 12, 2026 | 73 |
| Sep 11, 2026 | 61 |
| Sep 10, 2026 | 59 |
| Sep 9, 2026 | 58 |
| Sep 8, 2026 | 55 |
| Sep 7, 2026 | 57 |
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/1292287451-root)<a href="https://payloaddirectory.dev/plugins/1292287451-root"><img src="https://payloaddirectory.dev/badge/1292287451-root.svg" alt="Payload Directory"></a>README
Payload plugin for adding an icon picker field to the admin UI. The field stores a string, while editors can search and choose from the icons you register in the plugin config.
pnpm add @mvriu5/payload-icon-picker
Install the icon library you want to use in your project, for example:
pnpm add lucide-react
Register all icons once in your Payload config, then use iconField() wherever a Payload text field should become an icon picker.
import { postgresAdapter } from "@payloadcms/db-postgres"
import { lexicalEditor } from "@payloadcms/richtext-lexical"
import * as Icons from "lucide-react"
import { buildConfig } from "payload"
import { iconField, payloadIconPlugin } from "@mvriu5/payload-icon-picker"
import { lucideIconAdapter } from "@mvriu5/payload-icon-picker/adapters/lucide"
export default buildConfig({
collections: [
{
slug: "posts",
fields: [
{
name: "title",
type: "text",
required: true,
},
iconField({
name: "icon",
label: "Icon",
}),
],
},
],
plugins: [
payloadIconPlugin({
icons: lucideIconAdapter(Icons),
}),
],
db: postgresAdapter({
pool: {
connectionString: process.env.DATABASE_URL,
},
}),
editor: lexicalEditor(),
secret: process.env.PAYLOAD_SECRET,
})
iconField() creates a normal Payload text field. The selected icon is resolved to a string and stored in the database.
By default, the stored value is icon.value ?? icon.name. Adapters can prefix generated values so multiple icon libraries do not collide:
payloadIconPlugin({
icons: lucideIconAdapter(Icons, {
prefix: "lucide",
}),
})
Selecting ArrowRight would store:
lucide:ArrowRight
You can still use resolveIcon if you need a custom final storage format.
resolveIconWhen using payloadIconPlugin(), resolveIcon runs during Payload config setup. The resolved string is passed to the admin field as each icon's final value.
That means normal iconField() usage does not require passing resolveIcon to the admin component manually.
The resolveIcon prop on IconRenderer, IconField, and createIconResolver() is primarily for direct component usage, tests, or advanced cases where you bypass payloadIconPlugin(). If you use a custom resolveIcon for stored values, pass the same resolver when rendering or resolving those values outside the Payload admin UI.
Use IconRenderer from the client export to render a stored icon string in your frontend.
import * as Icons from "lucide-react"
import { IconRenderer } from "@mvriu5/payload-icon-picker/client"
import { lucideIconAdapter } from "@mvriu5/payload-icon-picker/adapters/lucide"
const icons = lucideIconAdapter(Icons)
export function PostIcon({ icon }: { icon?: string }) {
return <IconRenderer value={icon} icons={icons} className="post-icon" />
}
The renderer supports React icon components and adapter-generated SVG metadata. SVG output is sanitized before rendering.
If you need full control over rendering, use createIconResolver() to turn a stored string back into the registered icon.
import * as Icons from "lucide-react"
import { createIconResolver } from "@mvriu5/payload-icon-picker"
import { lucideIconAdapter } from "@mvriu5/payload-icon-picker/adapters/lucide"
const resolveStoredIcon = createIconResolver({
icons: lucideIconAdapter(Icons),
})
const resolvedIcon = resolveStoredIcon("Home")
Use an adapter for supported icon libraries. Adapters convert React icon exports to serializable SVG metadata for the Payload admin UI.
import * as Icons from "lucide-react"
import { lucideIconAdapter } from "@mvriu5/payload-icon-picker/adapters/lucide"
payloadIconPlugin({
icons: lucideIconAdapter(Icons),
})
import * as TablerIcons from "@tabler/icons-react"
import { tablerIconAdapter } from "@mvriu5/payload-icon-picker/adapters/tabler"
payloadIconPlugin({
icons: tablerIconAdapter(TablerIcons),
})
import * as SimpleIcons from "@icons-pack/react-simple-icons"
import { simpleIconsAdapter } from "@mvriu5/payload-icon-picker/adapters/simple-icons"
payloadIconPlugin({
icons: simpleIconsAdapter(SimpleIcons),
})
import * as Heroicons from "@heroicons/react/24/outline"
import { heroiconsAdapter } from "@mvriu5/payload-icon-picker/adapters/heroicons"
payloadIconPlugin({
icons: heroiconsAdapter(Heroicons),
})
import * as PhosphorIcons from "@phosphor-icons/react"
import { phosphorIconAdapter } from "@mvriu5/payload-icon-picker/adapters/phosphor"
payloadIconPlugin({
icons: phosphorIconAdapter(PhosphorIcons, {
weight: "regular",
}),
})
import * as Hugeicons from "@hugeicons/core-free-icons"
import { hugeiconsIconAdapter } from "@mvriu5/payload-icon-picker/adapters/hugeicons"
payloadIconPlugin({
icons: hugeiconsIconAdapter(Hugeicons),
})
Adapters support prefix, include, exclude, and optional label/value formatters:
When registering icons from more than one library, use a unique prefix for every adapter. Many icon libraries export generic names such as Home, Search, or User; prefixes keep stored values unique and make it clear which library an icon came from.
import * as SimpleIcons from "@icons-pack/react-simple-icons"
import * as TablerIcons from "@tabler/icons-react"
import { simpleIconsAdapter } from "@mvriu5/payload-icon-picker/adapters/simple-icons"
import { tablerIconAdapter } from "@mvriu5/payload-icon-picker/adapters/tabler"
payloadIconPlugin({
icons: [
...tablerIconAdapter(TablerIcons, {
label: ({ defaultLabel, prefix }) => `${prefix}:${defaultLabel.replace(/^Icon/, "")}`,
prefix: "tabler",
}),
...simpleIconsAdapter(SimpleIcons, {
prefix: "si",
}),
],
})
With prefix, the adapter keeps name as the original library export name and sets value to prefix:name, for example tabler:IconHome.
Without prefixes, duplicate icon values can collide. In development, the plugin warns when multiple registered icons resolve to the same stored value.
Or pass explicit icon metadata:
payloadIconPlugin({
icons: [
{
Icon: Icons.Home,
keywords: ["house", "start"],
label: "Home",
name: "Home",
value: "home",
},
],
})
iconField() accepts normal single-value Payload text field options, plus picker labels and per-field icon filters:
iconField({
name: "icon",
label: "Icon",
required: true,
placeholder: "Search icons",
noResultsLabel: "No icons found",
admin: {
position: "sidebar",
},
})
Use libraries to limit a field to icons from selected adapter prefixes:
iconField({
name: "navigationIcon",
label: "Navigation Icon",
libraries: ["lucide"],
})
Use icons to allow only specific stored icon values:
iconField({
name: "socialIcon",
label: "Social Icon",
icons: ["si:SiGithub", "si:SiDiscord"],
})
You can combine both options. The filters are additive, so this example allows all Lucide icons plus the explicit GitHub icon:
iconField({
name: "featuredIcon",
libraries: ["lucide"],
icons: ["si:SiGithub"],
})
The dev Payload config in dev/payload.config.ts registers the plugin with lucide-react, which is installed as a development dependency.
pnpm dev
Generate the Payload import map after changing admin components:
pnpm generate:importmap
Build the package:
pnpm build
payload icon picker
Icon picker field for Payload v4 that stores the icon name and raw SVG, with dropdown or drawer modes
7027/wk0v4
payload phone number plugin
Phone number field with country selection, as-you-type formatting and validation in the Payload admin
69837/wk17v3
icons
Manage SVG icons as CMS content with icon sets, an admin select widget and a server Icon component
5732/wk37v3
payload better fields plugin
Improved admin panel fields for slugs, numbers, patterns, ranges, colours, phones, alerts and dates
554.2k/wk294v3
payload plugin icons
Icon picker field for Payload with Lucide and Phosphor providers and a React rendering component
5522/wk2v3
payload color picker field
A color picker field for Payload collections that stores HEX color values
531.6k/wk41v3