innovixx

payload icon picker field

by innovixx
Custom fields
v3
^3.2.2
MIT

Overview

Summary generated from the README

Adds an icon picker field to Payload collections through a field helper function. Editors choose an icon in the admin panel, and icons can come from a react-icons pack or from a set of custom SVG strings. Targets Payload 3.2.2 or newer.

Features

  • Icon picker field helper usable in any collection or global
  • Accepts a react-icons pack such as Font Awesome 6
  • Accepts custom SVG icons defined by name
  • Configurable field name and label

Use cases

  • Let editors pick an icon for a feature list or call-to-action block
  • Offer a curated set of brand SVG icons in the admin

From the author

payload-icon-picker-field

Installation

npm i @innovixx/payload-icon-picker-field

57

Stars

9

Forks

4

Open Issues

9 months ago

Last Updated

0

Weekly Downloads

v

npm Version

Dependencies

GitHub stars

570 since Sep 6

Show data
GitHub stars by day (UTC)
DateStars
Dec 5, 202657
Dec 4, 202657
Dec 3, 202657
Dec 2, 202657
Dec 1, 202657
Nov 30, 202657
Nov 29, 202657
Nov 28, 202657
Nov 27, 202657
Nov 26, 202657
Nov 25, 202657
Nov 24, 202657
Nov 23, 202657
Nov 22, 202657
Nov 21, 202657
Nov 20, 202657
Nov 19, 202657
Nov 18, 202657
Nov 17, 202657
Nov 16, 202657
Nov 15, 202657
Nov 14, 202657
Nov 13, 202657
Nov 12, 202657
Nov 11, 202657
Nov 10, 202657
Nov 9, 202657
Nov 8, 202657
Nov 7, 202657
Nov 6, 202657
Nov 5, 202657
Nov 4, 202657
Nov 3, 202657
Nov 2, 202657
Nov 1, 202657
Oct 31, 202657
Oct 30, 202657
Oct 29, 202657
Oct 28, 202657
Oct 27, 202657
Oct 26, 202657
Oct 25, 202657
Oct 24, 202657
Oct 23, 202657
Oct 22, 202657
Oct 21, 202657
Oct 20, 202657
Oct 19, 202657
Oct 18, 202657
Oct 17, 202657
Oct 16, 202657
Oct 15, 202657
Oct 14, 202657
Oct 13, 202657
Oct 12, 202657
Oct 11, 202657
Oct 10, 202657
Oct 9, 202657
Oct 8, 202657
Oct 7, 202657
Oct 6, 202657
Oct 5, 202657
Oct 4, 202657
Oct 3, 202657
Oct 2, 202657
Oct 1, 202657
Sep 30, 202657
Sep 29, 202657
Sep 28, 202657
Sep 27, 202657
Sep 26, 202657
Sep 25, 202657
Sep 24, 202657
Sep 23, 202657
Sep 22, 202657
Sep 21, 202657
Sep 20, 202657
Sep 19, 202657
Sep 18, 202657
Sep 17, 202657
Sep 16, 202657
Sep 15, 202657
Sep 14, 202657
Sep 13, 202657
Sep 12, 202657
Sep 11, 202657
Sep 10, 202657
Sep 9, 202657
Sep 8, 202657
Sep 7, 202657
Sep 6, 202657
npm weekly downloads

Trends appear after 7 days of data. Collecting since Oct 22 — 1 daily snapshot so far.

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

Health Score

26/100Fair

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/720197221-root.svg)](https://payloaddirectory.dev/plugins/720197221-root)
HTML
<a href="https://payloaddirectory.dev/plugins/720197221-root"><img src="https://payloaddirectory.dev/badge/720197221-root.svg" alt="Payload Directory"></a>
Updated Feb 16, 2026Created Nov 17, 2023

README

Payload Icon Picker Field

NPM

A field for Payload which implements a robust icon picker which can be used with react-icons or custom svg icons.

payload-icon-picker-field-screenshot.png

Core features:

  • {{core features list}}

Installation

  yarn add @innovixx/payload-icon-picker-field
  # OR
  npm i @innovixx/payload-icon-picker-field

Basic Usage

import * as fa6Icons from 'react-icons/fa6'
import iconPickerField from '@innovixx/payload-icon-picker-field'
import type { CollectionConfig } from 'payload/types'

const Pages: CollectionConfig = {
  slug: 'pages',
  admin: {
    useAsTitle: 'title',
  },
  fields: [
    {
      name: 'title',
      type: 'text',
      required: true,
    },
    iconPickerField({
      name: 'customIcons',
      label: 'Custom Icons',
      icons: {
        house: '<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 576 512"...',
        user: '<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 576 512"...',
        check: '<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 576 512"...',
      },
    }),
    iconPickerField({
      name: 'reactIconsIcon',
      label: 'React Icons',
      reactIconPack: fa6Icons,
    }),
  ],
}

export default Pages

Development

To actively develop or debug this plugin you can either work directly within the demo directory of this repo, or link your own project.

  1. Internal Demo

    This repo includes a fully working, self-seeding instance of Payload that installs the plugin directly from the source code. This is the easiest way to get started. To spin up this demo, follow these steps:

    1. First clone the repo
    2. Then, cd YOUR_PLUGIN_REPO && yarn && cd demo && yarn && yarn cleanDev
    3. Now open http://localhost:3000/admin in your browser
    4. Enter username [email protected] and password Pa$$w0rd!

    That's it! Changes made in ./src will be reflected in your demo. Keep in mind that the demo database is automatically seeded on every startup, any changes you make to the data get destroyed each time you reboot the app.

  2. Linked Project

    You can alternatively link your own project to the source code:

    1. First clone the repo
    2. Then, cd YOUR_PLUGIN_REPO && yarn && cd demo && cp env.example .env && yarn && yarn dev
    3. Now cd back into your own project and run, yarn link @innovixx/payload-icon-picker-field
    4. If this plugin using React in any way, continue to the next step. Otherwise skip to step 7.
    5. From your own project, cd node_modules/react && yarn link && cd ../react-dom && yarn link && cd ../../
    6. Then, cd YOUR_PLUGIN_REPO && yarn link react react-dom

    All set! You can now boot up your own project as normal, and your local copy of the plugin source code will be used. Keep in mind that changes to the source code require a rebuild, yarn build.

    You might also need to alias these modules in your Webpack config. To do this, open your project's Payload config and add the following:

    import { buildConfig } from "payload/config";
    
    export default buildConfig({
      admin: {
        webpack: (config) => ({
          ...config,
          resolve: {
            ...config.resolve,
            alias: {
              ...config.resolve.alias,
              react: path.join(__dirname, "../node_modules/react"),
              "react-dom": path.join(__dirname, "../node_modules/react-dom"),
              payload: path.join(__dirname, "../node_modules/payload"),
              "@innovixx/payload-icon-picker-field": path.join(
                __dirname,
                "../../payload/payload-plugin-boilerplate/src"
              ),
            },
          },
        }),
      },
    });
    

Tags

Similar plugins