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

AnnotationRenderProps

AnnotationRenderProps = object

Defined in: packages/editor/src/renderers/renderer.types.ts:128

An annotation’s render function. Receives the annotation’s markDef object and wraps the styled text it applies to. The engine anchors the text in a <span> outside this render regardless of whether a render is registered; this render’s job is the styling wrapper only.

The render is a plain function call, not a component: do not call hooks in it. When you need hooks, return an element of your own component: render: (props) => <MyAnnotation {...props} />.

annotation: PortableTextObject

Defined in: packages/editor/src/renderers/renderer.types.ts:135

The annotation’s markDef object: {_key, _type, ...fields}. Named annotation, not node, because path addresses the span leaf carrying the annotation; the markDef itself lives in the block’s markDefs array.


children: ReactElement

Defined in: packages/editor/src/renderers/renderer.types.ts:136


focused: boolean

Defined in: packages/editor/src/renderers/renderer.types.ts:137


path: Path

Defined in: packages/editor/src/renderers/renderer.types.ts:138


readOnly: boolean

Defined in: packages/editor/src/renderers/renderer.types.ts:139


renderDefault: (props) => ReactElement

Defined in: packages/editor/src/renderers/renderer.types.ts:146

Render this position with the engine’s default wrapper. See ContainerRenderProps.renderDefault. The default is identity: the engine applies no annotation markup of its own.

AnnotationRenderProps

ReactElement


selected: boolean

Defined in: packages/editor/src/renderers/renderer.types.ts:140