we-are-you

payloadcms slate plugin textcolor leaf

by we-are-you
Rich text & editors
v2
^2.0.0

Overview

Summary generated from the README

Adds a text color leaf to the Slate editor in Payload. Editors choose from a predefined list of labeled colors that you configure. It is registered in the leaves array of the slateEditor admin options and targets Payload 2.x.

Features

  • Text color leaf for the Slate editor
  • Predefined list of colors with labels and hex values
  • Configurable leaf name
  • Registered through the slateEditor admin leaves option

Use cases

  • Highlight brand colors in rich text content for editors
  • Restrict editors to an approved color palette in Slate fields

From the author

payloadcms-slate-plugin-textcolor-leaf

Installation

npm i @wru/payloadcms-slate-plugin-textcolor-leaf

5

Stars

0

Forks

1

Open Issues

2 years ago

Last Updated

0

Weekly Downloads

v0.1.0

npm Version

14.5 KB

Unpacked Size

0

Dependencies

GitHub stars

Trends appear after 7 days of data. Daily snapshots have not started yet.

npm weekly downloads

Trends appear after 7 days of data. Daily snapshots have not started yet.

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

Health Score

18/100Poor

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/750330058-root.svg)](https://payloaddirectory.dev/plugins/750330058-root)
HTML
<a href="https://payloaddirectory.dev/plugins/750330058-root"><img src="https://payloaddirectory.dev/badge/750330058-root.svg" alt="Payload Directory"></a>
Updated Feb 10, 2024Created Jan 30, 2024Published Feb 10, 2024

README

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',
                    },
                ],
            }),
        ],
    },
}),

Similar plugins