1.4.0 • Published 4 months ago

payload-lucide-picker v1.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

Payload Lucide Picker

A custom field for Payload CMS that allows you to select and configure Lucide icons in your admin panel.

Features

  • 🎨 Select from all available Lucide icons
  • 🎯 Configure icon size, color, and stroke width
  • ♿ Accessible and keyboard-friendly
  • 🔄 Reset to default configuration

Installation

# Using pnpm
pnpm add payload-lucide-picker

# Using npm
npm install payload-lucide-picker

# Using yarn
yarn add payload-lucide-picker

Usage

  1. Import the field in your Payload config:
import { LucideIconPicker } from 'payload-lucide-picker';

// In your collection config
{
  fields: [
    {
      name: 'icon',
      type: 'lucide-icon',
      required: true,
      label: 'Select an Icon',
      admin: {
        description: 'Choose an icon and configure its appearance'
      }
    }
  ]
}
  1. The field will store the icon configuration in the following format:
{
  name: string;
  config: {
    size: number;
    color: string;
    strokeWidth: number;
  }
}
  1. Use the icon in your frontend:
import { Icon } from 'lucide-react';

const MyComponent = ({ icon }) => {
  const IconComponent = Icon[icon.name];
  
  return (
    <IconComponent
      size={icon.config.size}
      color={icon.config.color}
      strokeWidth={icon.config.strokeWidth}
    />
  );
};

Development

  1. Clone the repository
  2. Install dependencies: pnpm install
  3. Build the package: pnpm build
  4. Run tests: pnpm test

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT © Vectras

1.4.0

4 months ago

1.3.7

4 months ago

1.3.6

4 months ago

1.3.5

4 months ago

1.3.3

4 months ago

1.3.2

4 months ago

1.3.1

4 months ago

1.3.0

4 months ago

1.2.0

4 months ago

1.1.0

4 months ago

1.0.0

4 months ago