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

TextBlock

TextBlock = object

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

A text block registration. The text block _type is 'block' at the top level. Positional overrides nested in a container’s of array can register a different _type to render at that lexical scope.

defineTextBlock opts the text block into the new render pipeline. The consumer’s render callback owns the outer wrapper entirely: the engine emits data-pt-* attributes only, no pt-* CSS classes and no legacy data-block-* attributes.

Span-level rendering - decorator and annotation registrations, renderPlaceholder, and range decorations - keeps working. It fires on the spans inside children regardless of which text block outer wrapper renders them.

kind: "textBlock"

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


optional of: ReadonlyArray<Span | InlineObject | Decorator | Annotation>

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

Inline-content positional overrides. A Span or InlineObject placed here scopes the inline render to this text block (or any text block of this type if registered at the top level). Decorator and Annotation entries scope those renders the same way: the decorator or annotation renders through this entry inside the text block, and through the global registration everywhere else.


optional render: TextBlockRender

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

Outer render. Two modes:

  • omitted: fall through to global registered render (or engine default)
  • function: use this render. The function receives a renderDefault prop that returns the engine default when called.

type: string

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