Skip to content

docs(content-manager): add addRichTextBlocks API documentation#3100

Open
butcherZ wants to merge 1 commit intomainfrom
doc/add-rich-text-blocks-customization-api
Open

docs(content-manager): add addRichTextBlocks API documentation#3100
butcherZ wants to merge 1 commit intomainfrom
doc/add-rich-text-blocks-customization-api

Conversation

@butcherZ
Copy link
Copy Markdown
Member

@butcherZ butcherZ commented Apr 28, 2026

What does it do?

Documents the new addRichTextBlocks API added to the Content Manager plugin in strapi/strapi (feat/rich-text-blocks-customization).

Why is it needed?

The API allows Strapi applications and plugins to register custom block types in the Blocks rich text field. Without documentation, developers have no reference for how to use it.

Changes

  • cms/plugins-development/content-manager-apis: Adds a new ### addRichTextBlocks section documenting the API, its 2 call signatures (object and function), and a full block definition property table. Updates the <Tldr> to mention the new API.
  • cms/admin-panel-customization/wysiwyg-editor: Adds a note clarifying this page covers the markdown WYSIWYG editor, with a cross-reference to addRichTextBlocks for the Blocks field.

How to test it?

Review the rendered output on the preview deployment.

Related issue(s)/PR(s)

CMS-637

strapi/strapi#22063

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
documentation Ready Ready Preview, Comment Apr 28, 2026 10:33am

Request Review

@github-actions github-actions Bot added pr: updated content PRs updating existing documentation content source: CMS internal PRs created by the Strapi core team labels Apr 28, 2026
@butcherZ butcherZ requested a review from pwizla April 28, 2026 10:33
| `handleShiftTab` | No | Custom Shift+Tab key behavior. |
| `snippets` | No | Typing one of these strings followed by Space triggers a conversion to this block type. |
| `dragHandleTopMargin` | No | Adjusts the vertical position of the drag-to-reorder grip icon. |
| `plugin` | No | A [Slate plugin](https://docs.slatejs.org/) registered when the editor instance is created. Use this for custom normalizers or Slate-level behavior. |
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `plugin` | No | A [Slate plugin](https://docs.slatejs.org/) registered when the editor instance is created. Use this for custom normalizers or Slate-level behavior. |
| `plugin` | No | A <ExternalLink text="Slate plugin" to="https://docs.slatejs.org/" /> registered when the editor instance is created. Use this for custom normalizers or Slate-level behavior. |

There's a custom component for links that point outside Strapi docs, and we must use it 😊

| Property | Required | Description |
|---|---|---|
| `renderElement` | Yes | React render function. Spread `props.attributes` on the root element and render `props.children`. |
| `matchNode` | Yes | Returns `true` if a given Slate node belongs to this block type. |
Copy link
Copy Markdown
Collaborator

@pwizla pwizla Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd add the same component here (see my comment below). At first read I didn't know what Stale was 🤓

| `icon` | No | Icon component shown in the toolbar dropdown. Required when `isInBlocksSelector` is `true`. |
| `label` | No | `MessageDescriptor` (`{ id, defaultMessage }`) shown in the toolbar dropdown. Required when `isInBlocksSelector` is `true`. |
| `handleConvert` | No | Called when the user selects this block from the dropdown. Use Slate's `Transforms` to set the node type. |
| `handleEnterKey` | No | Custom Enter key behavior inside this block. |
Copy link
Copy Markdown
Collaborator

@pwizla pwizla Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@butcherZ Do you think we could give a short example of how to customize keys behavior (Enter, Backspace, Tab, ShiftTab…)?
What's expected here? Makes me think that we should add a Type column (after Description) to the whole table so readers know if each property is meant to be a boolean, string, React component, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal PRs created by the Strapi core team pr: updated content PRs updating existing documentation content source: CMS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants