Function: ToggleBlockAttr()

July 30, 2026 ยท View on GitHub

API


Function: ToggleBlockAttr()

ToggleBlockAttr<T, N, K>(editor, key, onValue, offValue, offset?): void

Defined in: commands.ts:150

Toggle attr of block node at the caret or specified position.

Type Parameters

T

T extends DocNode

N

N extends DocNode | object & DocNode

K

K extends string

Parameters

editor

Editor<T>

key

K

onValue

ExtractAttrValue<N, K>

offValue

ExtractAttrValue<N, K>

offset?

number = ...

Returns

void

Contents

  1. 1Type Parameters
  2. 1.1T
  3. 1.2N
  4. 1.3K
  5. 2Parameters
  6. 2.1editor
  7. 2.2key
  8. 2.3onValue
  9. 2.4offValue
  10. 2.5offset?
  11. 3Returns