Skip to main content
The Blocks field stores an ordered array in which each item can use a different schema. It is useful for page builders, forms, and other content that mixes reusable structures. Unlike an Array field, where every row has the same shape, a Blocks field lets editors mix configured block types in any order. Common uses include:
  • Page builders with quote, call-to-action, slider, and gallery blocks
  • Form builders with text, select, and checkbox blocks
  • Event agendas with break, presentation, and breakout-session blocks
Each stored item includes blockType, whose value is the block’s slug, and an optional editor-controlled blockName.

Field config options

Field admin options

Blocks fields inherit the standard field admin options and add:

Copying and pasting blocks

The admin panel can copy and paste individual block rows or the complete contents of a Blocks field. These actions are available from each row’s action menu and the field-level action menu.

Row-level and field-level actions

  • Copy Row copies one block and lets you paste it at a chosen position in a compatible Blocks field.
  • Copy Fields copies every block in the field.
  • Duplicate immediately inserts a copy below the original block in the same field and document.
  • Paste Fields replaces the target field’s entire contents with the clipboard contents.
Copy and paste can move blocks between compatible fields and documents in browser tabs on the same origin. Clipboard data is kept in browser storage and is not shared between different FrogBot origins. FrogBot checks that the target field includes the copied block type and regenerates block and nested Array row IDs when pasting.

Block items

Blocks are separate, reusable configuration objects. Define block objects outside collection definitions when multiple fields or collections use the same schema.

Block config options

Block admin options

Blocks are configuration objects rather than fields, so their admin options are independent of the standard field admin options:

Block images

admin.images.icon appears in Rich Text menus and toolbars at 20 by 20 pixels. Square SVG or transparent PNG assets work best. If no icon is configured, the thumbnail is used as a fallback. admin.images.thumbnail appears in the block-selection drawer at a 3:2 aspect ratio. Other ratios are cropped with object-fit: cover, so keep important content centered. Each image accepts either a URL string or an object containing url and optional alt text.
URL strings are useful when separate alternative text is unnecessary:
Both images can also use URL strings:
When images is omitted, the admin panel supplies default graphics.

Block type, name, and label

Each block row stores blockType and may store blockName. The block config’s labels apply to every block of that type, while blockName belongs to one row. admin.components.Label replaces both the configured block label and the editable row-name presentation.

Root block registration

Register a reusable block once in the root config, then reference it by slug. Object references are also accepted.
Referenced block configuration is shared and cannot be extended at the field. Its access control runs without collection-specific sibling data. The root registration prevents the same block schema from being sent and processed repeatedly when many fields reuse it.

TypeScript

Use the public Block type for separately authored block objects and BlocksField for complete field objects:
interfaceName gives the block a reusable top-level interface when you run frogbot generate:types.

Conditional blocks

filterOptions can return true for all configured blocks or an array of allowed slugs. It is reevaluated when form state changes, and saving fails if an existing block is no longer allowed. A callback receives data, id, siblingData, user, and req, the current FrogBotRequest with req.frogbot.

Lexical blocks

The same FrogBot Block objects can be embedded in a Lexical Rich Text field with BlocksFeature:
Nested Rich Text fields need their own editor. See the Rich Text field for editor configuration.

Custom Lexical rendering

A block’s admin.components.Block replaces its preview inside the Lexical editor, and admin.components.Label replaces its label. Server previews use LexicalBlockServerProps; client previews use LexicalBlockClientProps. The Block type also preserves jsx conversion metadata for compatible Rich Text rendering pipelines. Configure it on the reusable block rather than creating a second schema for rendering. Client previews can reuse the editor’s public controls instead of rebuilding edit and remove behavior:
Use the regular block controls for block previews and the inline controls for inline block previews. BlockCollapsible and InlineBlockContainer provide the corresponding default containers.

Custom components

Replace the Blocks field while retaining the default UI:
Client field replacements receive props compatible with the default field component:
Replace only the field label when the default Blocks interface should remain unchanged:
Use BlocksFieldLabelClientProps for a client label and BlockRowLabelServerProps or BlockRowLabelClientProps for block rows. Lexical block previews use LexicalBlockServerProps or LexicalBlockClientProps from @frogbotai/richtext-lexical. Configure their component paths on the block’s admin.components.Block slot.