notchris

payload table field

by notchris
Custom fields
v1
v2
^0.18.5 || ^1.0.0 || ^2.0.0
MIT

Overview

Summary generated from the README

Adds a table field to Payload collections, rendered in the admin with React Table. You call the tableField helper inside a collection's fields array with a field config and table options such as columns, pagination and editable cells. Supports Payload 0.18.5, 1.x and 2.x.

Features

  • Display and edit tabular data inside a Payload field
  • Pagination with configurable default and available page sizes
  • Per-column sorting that can be enabled individually
  • Optional row selection
  • Configurable columns with key and name
  • Default table data via the field's defaultValue

Use cases

  • Embed structured tabular data such as lists or datasets in a document
  • Let editors review and sort rows of data directly in the admin panel

From the author

A table field (React Table) for Payload

Installation

npm i payload-table-field

25

Stars

1

Forks

1

Open Issues

2 years ago

Last Updated

31

Weekly Downloads

v1.1.0

npm Version

67.3 KB

Unpacked Size

4

Dependencies

GitHub stars

250 since Sep 6

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

23−5 since Sep 6

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

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

Health Score

39/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/767805757-root.svg)](https://payloaddirectory.dev/plugins/767805757-root)
HTML
<a href="https://payloaddirectory.dev/plugins/767805757-root"><img src="https://payloaddirectory.dev/badge/767805757-root.svg" alt="Payload Directory"></a>
Updated Aug 6, 2024Created Mar 5, 2024Published May 12, 2024

README

Payload Table Field

Adds a table field (using React Table) to Payload.

Features:

  • Display / Edit data using React Table
  • Pagination
  • Sorting
  • Row Selection

image

Installation

  yarn add payload-table-field
  #OR
  npm i payload-table-field

Basic Usage

Import the field and then use it in your payload collection fields array.

// import plugin
import { CollectionConfig, Field } from 'payload/types'
import { tableField } from 'payload-table-field'

import mockData from '../mocks/mockData'

const Examples: CollectionConfig = {
  slug: 'examples',
  admin: {
    useAsTitle: 'title',
  },
  fields: [
    {
      type: 'text',
      name: 'title',
    },
    tableField(
      {
        name: 'table_example',
        label: 'Example Table - Movies',
        defaultValue: mockData,
      },
      {
        pagination: true, // Enable pagination?
        paginationPageSize: 10, // Default pagination page size
        paginationPageSizes: [5, 10, 25, 50, 100], // Available pagination page sizes
        editable: false, // Allow cells to be edited?
        rowSelection: true, // Enable row selection
        columns: [
          {
            key: 'id',
            name: 'ID',
            enableSorting: true // Allow this column to be sorted
          },
          { key: 'title', name: 'Title' },
          { key: 'year', name: 'Year' },
        ],
      },
    ) as Field,
  ],
}

export default Examples

Note

While this plugin is still in development, the basic feature set of React Table has been implemented.

Similar plugins