Rich Text Field
Pre-configured Lexical editor
Usage
import { richTextField } from '@adsign/payload-adsign-plugin';
richTextField({
name: 'content',
label: 'Content',
type: 'full',
})Variants
Simple: Bold, italic, underline, lists, links
Full: All simple features + strikethrough, headings, blocks, inline code
Options
| Option | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Field name |
type | 'simple' | 'full' | Yes | Editor variant |
label | string | No | Field label |
blocks | string[] | No | Custom blocks |
inlineBlocks | string[] | No | Inline blocks |
linkEnabledCollections | string[] | No | Collections for links |
enabledHeadingSizes | string[] | No | Allowed headings |
additionalFeatures | Feature[] | No | Custom Lexical features |
Examples
With blocks:
richTextField({
name: 'content',
label: 'Content',
type: 'full',
blocks: ['imageBlock', 'videoBlock'],
})Only H2 and H3:
richTextField({
name: 'content',
label: 'Content',
type: 'full',
enabledHeadingSizes: ['h2', 'h3'],
})