Skip to content
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).

DecoratorRender

string

Decorator

defineDecorator({
type: 'strong',
render: ({children}) => <strong>{children}</strong>,
})