Skip to content

we-are-you/payloadcms-slate-plugin-textcolor-leaf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PayloadCMS SlateEditor Leaf - TextColor

Add a simple text color picker - a predefined list - to the SlateJS editor.

Installation

  yarn add @wru/payloadcms-slate-plugin-textcolor-leaf
  # OR
  npm i @wru/payloadcms-slate-plugin-textcolor-leaf

Usage

Add the leav to the slateEditor. For example in payload.config.ts

editor: slateEditor({
    admin: {
        leaves: [
            wruTextColorLeaf({
                name: 'color_picker',
                colorList: [
                    {
                        label: 'Primary',
                        color: '#8BE28C',
                    },
                    {
                        label: 'Secondary',
                        color: '#87021f',
                    },
                ],
            }),
        ],
    },
}),