docs(content-manager): add addRichTextBlocks API documentation#3100
Open
docs(content-manager): add addRichTextBlocks API documentation#3100
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
pwizla
reviewed
Apr 29, 2026
| | `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. | |
Collaborator
There was a problem hiding this comment.
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 😊
pwizla
reviewed
Apr 29, 2026
| | 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. | |
Collaborator
There was a problem hiding this comment.
I'd add the same component here (see my comment below). At first read I didn't know what Stale was 🤓
pwizla
reviewed
Apr 29, 2026
| | `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. | |
Collaborator
There was a problem hiding this comment.
@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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does it do?
Documents the new
addRichTextBlocksAPI 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### addRichTextBlockssection 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 toaddRichTextBlocksfor 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