Skip to main content
FrogBot’s Rich Text editor is based on Lexical. It provides formatting, links, files, relationships, lists, and extension points through composable features.

Configure the root editor

The root editor supplies the default configuration for top-level Rich Text fields. Override editor on an individual field when it needs a different feature set.

Editor options

lexicalEditor accepts one optional object. Call it with no argument or {} to use the recommended feature set and the built-in Lexical configuration.

Extend the editor with features

Features add nodes, converters, toolbar controls, and other editor behavior. features accepts an array or a function. The function receives the recommended defaults and the features configured on the root editor.

Feature function arguments

See Official features for the complete built-in set. If you omit defaultFeatures, the editor starts with no features. This is useful when you want a deliberately small editor rather than the recommended feature set.

TypeScript

Each serialized node type starts with Serialized, such as SerializedUploadNode. Use TypedEditorState when you want an exact union of allowed nodes:
DefaultTypedEditorState includes all nodes from the default feature set and accepts additional node types as its generic argument.
Import SerializedEditorState from @frogbotai/richtext-lexical/lexical when code accepts any serialized editor state. Use types exported by @frogbotai/richtext-lexical rather than importing equivalent types from Lexical’s internal packages. FrogBot controls and tests the public wrapper types.

Admin customization

The editor’s admin property supports these options:

Detect an empty state

After an editor has been changed, deleting all visible content may leave an empty paragraph in its JSON value. Use hasText when you need to distinguish content from an empty editor state: