This project is still a work in progress.

payload bricks
Fields

Rich text

Used for rich text / WYSIWYG content

Installation

npx shadcn@latest add https://payload-bricks.bblank.dev/r/rich-text-field.json

Usage

example-config.ts
import { richTextField } from "@/fields/rich-text"
import type { Block } from "payload"

export const ExampleBlock: Block = {
  slug: "example",
  interfaceName: "Example",
  fields: [
    // your other fields
    richTextField,
  ],
}
example-block.tsx
import { RichText } from "@/components/rich-text"
import type { Example } from "@/payload-types"

export function ExampleBlock(props: Example) {
  return props.richText ? <RichText data={props.richText} /> : null
}

Field structure

nametype
richTextrich text

Customization

Pass enableProse={false} to remove the default max-w-prose class.

On this page