GCBGutenberg
Control Blocks
Buy

Field type

richtext

Tiptap-backed rich text editor. Lighter than the TinyMCE wysiwyg control — no jQuery, no global state. Renders inline on wide surfaces and as a popover/modal in the narrow block Inspector.

Type: richtext · Stored attribute type: string

Stored value

string — HTML, e.g. <p>Hello <strong>world</strong></p>. Empty document normalises to "".

Supports

  • Bold / italic / strike / inline code
  • Bullet and numbered lists, blockquote
  • Headings (configurable allowed levels)
  • Links via a popover
  • Image insertion via the media library
  • Undo / redo
  • Three display modes: inline, popover, modal

Config options

OptionTypeDefaultDescription
headingLevelsnumber[][2, 3, 4]Which heading levels appear in the block-type select.
allowImagesbooleantrueShow the insert-image toolbar button. Set to false for caption-style fields.
displaystring — "inline" | "popover" | "modal"Force a specific display mode. Default behaviour: popover in sidebar variants, inline on wide surfaces.
placeholderstringGreyed-out hint shown on the collapsed button in popover/modal mode.

Gotchas

  • Empty editor returns "", not "<p></p>". Required-validation works correctly.
  • The TinyMCE-based wysiwyg control is a backwards-compat alias for this — same component, same stored HTML shape.

Example

JSON
{ "id": "ctrl_body",
  "type": "richtext",
  "label": "Body",
  "attributeKey": "body",
  "headingLevels": [2, 3],
  "parentPanelId": "panel" }

Consume

JSX

JSX
export default function Body({ attributes }) {
  const html = attributes.body || '';
  return <div className="body" dangerouslySetInnerHTML={{ __html: html }} />;
}

PHP

PHP
<?php
$html = $attributes['body'] ?? '';
?>
<div class="body"><?php echo wp_kses_post($html); ?></div>

Every field also takes the keys common to all fields.

Built from GCB Lite 0.4.0 (ce232d4). Source: schemas/controls/richtext.md.

Copyright © 2026 Runchain. WordPress is a trademark of the WordPress Foundation.