Plate
is the root component loading the editor state into a store provider.
PlateContent
is the component that renders the editor.
<Plate>
editor
: The Plate editor instancenode
: The node after the operationoperation
: The node operation that occurredprevNode
: The node before the operationeditor
: The Plate editor instancenode
: The parent node (block or inline element) containing the text that changedoperation
: The text operation that occurred (insert_text
orremove_text
)prevText
: The text content before the operationtext
: The text content after the operation- Default:
true
Children components have access to the plate store.
A controlled editor
instance. This prop is required.
See Slate docs.
Controlled callback called when the editor state changes.
Callback called when the editor selection changes.
Callback called when the editor value changes.
Callback called whenever a node operation occurs (insert, remove, set, merge, split, move).
Parameters:
Note: For insert_node
and remove_node
operations, both node
and prevNode
contain the same value to avoid null cases.
Callback called whenever a text operation occurs (insert or remove text).
Parameters:
Controls whether the editor is considered active by default when used with a PlateController.
If true, the editor is in read-only mode.
Custom render function for elements.
Custom render function for leaf nodes.
<PlateContent>
Props for the Editable component. Extends TextareaHTMLAttributes<HTMLDivElement>
.
How Plate Works
Plate
requires an editor
prop, which should be an instance of PlateEditor
. If editor
is null
, Plate
will not render anything.
The Plate
component does not handle the creation of the editor or the management of plugins. These responsibilities are handled by createPlateEditor
.
Plate
provides a store for the editor state and renders its children. It uses PlateStoreProvider
to make the editor state and related functions available to its children components.
The rendering logic for elements and leaves is primarily handled by the plugins system, with renderElement
and renderLeaf
props serving as fallbacks if no plugin is found for a specific node type.
For more details on creating and configuring the editor, refer to the Editor Configuration guide.