Views and JSX converters
JSX converters are the simplest choice when content only needs custom frontend rendering. Views are useful when you want an Admin Panel preview, multiple rendering modes for one field, or one node map shared by the editor and frontend. When bothconverters and nodeMap are passed to RichText, the node map wins for each overlapping node type. Block and inline-block maps are merged by slug, with the node map winning for an overlapping slug.
Define views
The following view map uses real node narrowing and declares every custom block represented by its node union:View configuration
Each key of the view map is a view name. Add adefault key to replace the editor’s default rendering; other keys add views editors can switch to. Each view accepts:
Admin settings
View-level admin settings use the same options as rich text admin customization, except thatplaceholder must be a plain string because the view map is loaded in the browser:
Feature filtering
filterFeatures receives the active client feature map. Return a new map to remove or add features for that view. Removing toolbar features is useful for a read-focused preview, as shown in the complete map above.
Lexical configuration
Pass a function to extend the default Lexical editor configuration:Node overrides
A node override can use these rendering approaches:
For a decorator node that defines both
createDOM and html, the editor uses createDOM; JSX conversion uses html.
The node map follows the organization described in Converting JSX: built-in node types are top-level keys, while custom block slugs belong under blocks and inlineBlocks.
Customize block chrome
For a configured block,Block replaces the block’s content while retaining its surrounding form behavior. Narrow props.isEditor before calling useBlockComponentContext; that hook is available only in the editor variant.
nodes.blocks.banner.Block. Label replaces only the collapsible block label and is used only in the editor. The equivalent collection-level block customization is documented under Block custom components.
ViewMapBlockComponentProps is a union narrowed by isEditor. Block and Label components for inline blocks receive the same props, except that the editor variant provides useInlineBlockComponentContext instead of useBlockComponentContext.
Read the active view
Client components rendered within a rich text field can read the current view:Reuse a view on the frontend
Pass a view’s node map toRichText to use the same rendering outside the editor. Type the content with the generated field type from frogbot-types.
PostBody is a Client Component because it reads properties of the client-exported postViews map. A Server Component can render <PostBody content={content} />, but cannot read postViews.preview.nodes itself.
The frontend imports the entire module containing postViews. Keep that module safe for the frontend bundle and move editor-only components into separate component paths when they require client editor or Admin Panel dependencies.