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:197

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, no legacy data-block-* attributes - and the block-level renderStyle/renderListItem/renderBlock props on <PortableTextEditable> do not compose under this registration.

Span-level render props - renderDecorator, renderAnnotation, renderPlaceholder, and range decorations - keep working. They fire 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:198


optional of: ReadonlyArray<Span | InlineObject>

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

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).


optional render: TextBlockRender

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

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:199