@nexload-sdk/payload-fields
v2.0.0
Published
A collection of powerful, production-ready, and beautifully designed fields for Payload CMS, including an advanced date picker, automatic slug generator, and a feature-rich Lexical editor.
Downloads
35
Maintainers
Readme
@nexload-sdk/payload-fields
Reusable Payload CMS field helpers and admin components (date + slug) plus a preconfigured Lexical editor.
Install
pnpm add @nexload-sdk/payload-fieldsExports
Root exports:
editor(Lexical editor preset)dateFieldslugField- slug/date helper exports (
formatDate,formatSlug,formatSlugHook)
Subpath exports (used by Payload admin component paths):
@nexload-sdk/payload-fields/date@nexload-sdk/payload-fields/date/date-picker@nexload-sdk/payload-fields/date/date-cell@nexload-sdk/payload-fields/slug@nexload-sdk/payload-fields/slug/slug-field
editor
Preconfigured lexicalEditor(...) instance with features including:
- headings (
h1-h4) - fixed toolbar
- horizontal rule
- upload
- table (experimental)
- relationship feature (
products,articles)
Usage:
import { editor } from "@nexload-sdk/payload-fields";
{
name: "content",
type: "richText",
editor
}dateField(overrides?)
Returns [DateField] configured for Payload admin sidebar, with:
- custom field component (
DatePicker) - custom cell component (
DateCell) - Persian/Jalali formatting helpers
import { dateField } from "@nexload-sdk/payload-fields";
fields: [
...dateField()
];slugField(fieldToUse?, overrides?)
Returns [TextField, CheckboxField] for a slug and lock toggle.
- auto-formats slug values
- includes
beforeValidatehook - uses custom admin UI component with lock/unlock + generate action
import { slugField } from "@nexload-sdk/payload-fields";
fields: [
{ name: "title", type: "text", required: true },
...slugField("title")
];Notes
- Admin components are React client components and intended for Payload admin usage.
- Styles are bundled from package submodules (
date/index.scss,slug/index.scss).
