npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@focus-reactive/payload-plugin-json-form-builder

v1.6.0

Published

Edit a Payload JSON field as real admin fields. The shape lives in the value, is built in a drawer, and the site reads plain values by key

Readme

Payload JSON Form Builder

This plugin turns an ordinary json field into Payload components. An editor fills in text, picks images from Media, writes rich text, builds lists — and all of it lands back in the same json value, which your site reads as plain keys. The form those components make is built in the admin panel too: the plugin brings its own builder, where fields are added, renamed and reordered without a deploy.

The form a json field becomes

Installation

pnpm add @focus-reactive/payload-plugin-json-form-builder
pnpm payload generate:importmap
// payload.config.ts
plugins: [jsonFormPlugin({ richText: { editor: lexicalEditor() } })]

// any collection or global
fields: [jsonField({ name: 'settings' })]

How it works

Building a section describes it much the way you would describe a schema in code: every node has a kind, a key and a value. That description just does not live in your repository — it lives in the field. The plugin reads it and draws real Payload components, which are far nicer to work with than json in a textarea: fields are filled in, hidden, dragged, deleted, nearly everything an ordinary field allows.

There is one difference, and it is in your favour: a new section needs no migration. However many fields you add and however deeply you nest them, the database still holds one json field, and what leaves it is a plain object of keys.

// what is stored                            // what your site receives
[                                            {
  { "name": "hero",                            "hero": {
    "type": "collapsible",                       "title": "Hackathon",
    "fields": [                                  "live": true
      { "name": "title", "type": "text",       }
        "value": "Hackathon" },              }
      { "name": "live", "type": "checkbox",
        "value": true } ] }
]

The form is built in the builder: sections on the left, the palette of kinds on the right. Thirteen kinds — text, number, date, select, checkbox, upload, rich text, list, group, accordion, tabs — nested as deep as you like.

The builder

Options

jsonFormPlugin({
  // the library of reusable sections; off by default
  library: true,

  // the editor rich text is written with — without it the kind stays out of the palette
  richText: { editor: lexicalEditor() },

  // the collection the upload kind picks files from; media by default
  uploads: 'media',

  // who may change the form: a role, a list of roles, or your own rule
  // everyone who may edit the document, by default
  build: 'admin',

  // the global the plugin adds itself: it holds the rich text anchor and the library
  global: { slug: 'json-form' },
})

library — reusable sections

Even without it the plugin gives you a global where sections are built and rendered on the site. The library is about something else: sections that repeat across many pages.

It works as a reference. In the library you build a section — its form and, where it helps, default values. Any json field can then point at it: the values there are its own and are edited as usual, while the form comes from the library. The form can only be changed there — add a field and it appears in every page that points at the section.

// the library: either in the plugin's own global
jsonFormPlugin({ library: true })

// or as a field of your own, beside what it shares with
fields: [
  { type: 'group', label: 'Components', fields: [jsonField({ name: 'components' })] },
  { type: 'group', label: 'Shared sections', fields: [jsonLibraryField()] },
]

// a field that may point at them
jsonField({ name: 'settings', shares: true })

In that field's builder, two groups appear under Add section: Attached sections, each with a ×, and Shared sections, each with a +. In the form, an attached section carries a global chip.

Compatibility

| Payload | Plugin | | --- | --- | | 3.84+ | 1.x |

License

MIT