Skip to content
This page is available as Markdown at /editor/reference/plugins.md. For the full documentation index, see /llms.txt, or the complete corpus at /llms-full.txt.

Plugins

Plugins are React components placed inside the EditorProvider, and are primarily used to register Behaviors ad-hoc in the Editor using the editor.registerBehavior(...) API:

function LogTextPlugin() {
const editor = useEditor()
useEffect(() => {
const unregisterBehavior = editor.registerBehavior({
behavior: defineBehavior({
on: 'insert.text',
actions: [
({event}) => [
{
type: 'effect',
effect: () => {
console.log(event)
},
},
{
type: 'forward',
event,
},
],
],
}),
})
return () => {
unregisterBehavior()
}
}, [editor])
return null
}