This page is available as Markdown at /api/editor/functions/definedecorator.md. For the full documentation index, see /llms.txt, or the complete corpus at /llms-full.txt.
defineDecorator
defineDecorator(
config):Decorator
Defined in: packages/editor/src/renderers/renderer.types.ts:527
Define a decorator renderer for a decorator name declared in the
schema’s decorators array, or '*' to match every decorator.
The returned registration is mounted via the <NodePlugin>
component.
Decorator names live in a different namespace than node
_types, so type has no forbidden values here (unlike
defineSpan/defineTextBlock).
Parameters
Section titled “Parameters”config
Section titled “config”render?
Section titled “render?”string
Returns
Section titled “Returns”Example
Section titled “Example”defineDecorator({ type: 'strong', render: ({children}) => <strong>{children}</strong>,})