0.1.6 • Published 7 months ago

@jsxfill/payloadcms v0.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Payload CMS JSX Fill

By annotating files with /** @jsxImportSource @jsxfill/payloadcms */, you can switch to a different JSX resolver. With that you can use JSX for create plain JS objects, in this case this is Fields of PayloadCMS.

Usage

Creating a Global

/** @jsxImportSource @jsxfill/payloadcms */

import { Meta } from "../components/meta"

const Landing = (
  <global slug="landing">
    <collapsible label="Shared Settings" admin={{ initCollapsed: true }}>
      <Meta />
    </collapsible>
    <tabs label="Pages">
      <tab name="home" label="Home">
        <Meta />
      </tab>
    </tabs>
  </global>
)

export default Landing

Creating a Component

/** @jsxImportSource @jsxfill/payloadcms */

export function Meta() {
  return (
    <group name="meta">
      <group name="seo">
        <text name="site_name" />
        <text name="title" />
        <textarea name="description" minLength={40} maxLength={160} />
        <select name="keywords" options={[]} />
      </group>
      <group name="social">
        <text name="title" />
        <text name="description" />
        <upload name="image" relationTo="media" />
      </group>
    </group>
  )
}
0.1.6

7 months ago

0.1.4

7 months ago

0.1.3

7 months ago

0.1.2

7 months ago

0.1.1

7 months ago

0.1.0

7 months ago