notchris

payload label popover

by notchris
Admin customization
v2
^2.0.0
MIT

Overview

Summary generated from the README

Adds a popover to Payload field labels in the admin panel, rendered with React Tiny Popover. It is added to the plugins array and enabled per field through the custom object, using a text string or a custom React component as content. Targets Payload 2.x.

Features

  • Popover on field labels via React Tiny Popover
  • Enable per field through the custom config object
  • Plain text content for popovers
  • Custom React component content support

Use cases

  • Explain the purpose of a field to editors directly beside its label
  • Show rich help content in a popover for complex fields

From the author

A plugin to add descriptive popovers to field labels in Payload.

Installation

npm i payload-label-popover

18

Stars

1

Forks

1

Open Issues

2 years ago

Last Updated

11

Weekly Downloads

v1.0.1

npm Version

122.4 KB

Unpacked Size

1

Dependencies

GitHub stars

180 since Sep 7

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

12−6 since Sep 7

Show data
npm weekly downloads by day (UTC)
DateWeekly downloads
Dec 6, 202612
Dec 5, 202611
Dec 4, 20269
Dec 3, 20268
Dec 2, 20269
Dec 1, 20267
Nov 30, 20266
Nov 29, 20268
Nov 28, 202610
Nov 27, 202610
Nov 26, 202610
Nov 25, 202611
Nov 24, 202611
Nov 23, 202611
Nov 22, 202610
Nov 21, 20268
Nov 20, 20266
Nov 19, 20267
Nov 18, 20267
Nov 17, 20266
Nov 16, 20267
Nov 15, 20265
Nov 14, 20269
Nov 13, 202611
Nov 12, 202612
Nov 11, 202610
Nov 10, 202611
Nov 9, 202611
Nov 8, 202612
Nov 7, 20268
Nov 6, 20265
Nov 5, 20267
Nov 4, 20267
Nov 3, 20267
Nov 2, 20267
Nov 1, 20267
Oct 31, 20267
Oct 30, 20269
Oct 29, 20265
Oct 28, 20265
Oct 27, 20265
Oct 26, 20265
Oct 25, 20267
Oct 24, 202614
Oct 23, 202612
Oct 22, 202615
Oct 21, 202617
Oct 20, 202616
Oct 19, 202615
Oct 18, 202612
Oct 17, 20266
Oct 16, 20266
Oct 15, 20264
Oct 14, 20262
Oct 13, 20262
Oct 12, 20262
Oct 11, 20263
Oct 10, 20262
Oct 9, 20262
Oct 8, 20261
Oct 7, 20261
Oct 6, 20264
Oct 5, 20264
Oct 4, 20263
Oct 3, 20264
Oct 2, 20266
Oct 1, 20266
Sep 30, 20266
Sep 29, 202614
Sep 28, 202614
Sep 27, 202615
Sep 26, 202617
Sep 25, 202615
Sep 24, 202615
Sep 23, 202615
Sep 22, 20268
Sep 21, 20268
Sep 20, 20268
Sep 19, 20265
Sep 18, 20265
Sep 17, 20266
Sep 16, 20267
Sep 15, 20263
Sep 14, 20265
Sep 13, 20267
Sep 12, 202613
Sep 11, 202619
Sep 10, 202618
Sep 9, 202618
Sep 8, 202618
Sep 7, 202618

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

Health Score

36/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/776235992-root.svg)](https://payloaddirectory.dev/plugins/776235992-root)
HTML
<a href="https://payloaddirectory.dev/plugins/776235992-root"><img src="https://payloaddirectory.dev/badge/776235992-root.svg" alt="Payload Directory"></a>
Updated Mar 24, 2024Created Mar 23, 2024Published Mar 24, 2024

README

Payload Label Popover Plugin

Adds a descriptive popover to Payload field labels (using React Tiny Popover).

image

Installation

  yarn add payload-label-popover
  #OR
  npm i payload-label-popover

Basic Usage

Import the plugin and add it to your payload configuration file.

// Add the plugin to the "plugins" array in your payload config
{
  // ... Rest of payload config
  plugins: [labelPopoverPlugin({})]
}
// Enable a popover on a field using the `custom` object
const Examples: CollectionConfig = {
  slug: 'examples',
  admin: {
    useAsTitle: 'title',
  },
  fields: [
    {
      type: 'text',
      name: 'title',
      label: 'Hello World',
      custom: {
        labelPopover: 'This is a test to see if this popover will work and wrap correctly.',
        showLabelPopover: true,
      },
    },
  ],
}
export default Examples

Custom Component for Popover Content

You can also use a custom component to render content inside of the popover.

// CustomPopoverContent.tsx
import React from 'react'

type Props = {
  data: string
}

export const CustomPopoverContent: React.FC<Props> = props => {
  const { data } = props
  return <div style={{ color: 'yellow' }}>{data}</div>
}

Then import and pass the component to the 'labelPopover' property in your field config.

      custom: {
        labelPopover: LabelContent({ data: 'HELLO WORLD!!!' }),
        showLabelPopover: true,
      }

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Similar plugins