@mvriu5/payload-color-picker
v1.0.2
Published
A Payload CMS color picker field plugin.
Readme
Payload Color Plugin
A Payload CMS plugin for selecting colors in the admin UI and storing the selected value as a string.
The package structure and development environment are prepared. The field, picker UI, and plugin behavior will be implemented in the next step.
Usage
import { colorField, payloadColorPlugin } from "@mvriu5/payload-color-picker"
export default buildConfig({
collections: [
{
slug: "posts",
fields: [
colorField({
name: "color",
label: "Color",
}),
],
},
],
plugins: [
payloadColorPlugin({
suggestedColors: ["#111827", "#3B82F6", "#22C55E", "#F59E0B"],
}),
],
})The selected color is stored as a regular string field.
Development
cp dev/.env.example dev/.env
docker compose up -d
pnpm devBuild
pnpm build