Skip to main content

@lexical/extension/TabIndentationExtension

Interfaces​

TabIndentationConfig​

Defined in: packages/lexical-extension/src/TabIndentationExtension.ts:196

Properties​

$canIndent​

$canIndent: CanIndentPredicate

Defined in: packages/lexical-extension/src/TabIndentationExtension.ts:203

By default, indents are set on all elements for which the ElementNode.canIndent returns true. This option allows you to set indents for specific nodes without overriding the method for others.

disabled​

disabled: boolean

Defined in: packages/lexical-extension/src/TabIndentationExtension.ts:197

maxIndent​

maxIndent: number | null

Defined in: packages/lexical-extension/src/TabIndentationExtension.ts:198

Type Aliases​

CanIndentPredicate​

CanIndentPredicate = (node) => boolean

Defined in: packages/lexical-extension/src/TabIndentationExtension.ts:69

Parameters​

node​

ElementNode

Returns​

boolean

Variables​

TabIndentationExtension​

const TabIndentationExtension: LexicalExtension<TabIndentationConfig, "@lexical/extension/TabIndentation", NamedSignalsOutput<TabIndentationConfig>, unknown>

Defined in: packages/lexical-extension/src/TabIndentationExtension.ts:211

This extension adds the ability to indent content using the tab key. Generally, we don't recommend using this plugin as it could negatively affect accessibility for keyboard users, causing focus to become trapped within the editor.

Functions​

registerTabIndentation()​

registerTabIndentation(editor, maxIndent?, $canIndent?): () => void

Defined in: packages/lexical-extension/src/TabIndentationExtension.ts:116

Registers a KEY_TAB_COMMAND handler that makes Tab and Shift+Tab indent and outdent block elements (and otherwise insert a tab). Pass maxIndent to cap the indent depth (indents below maxIndent), and $canIndent to control which elements may be indented. The maxIndent cap applies to local edits, pastes, the initial state and parsed states passed to setEditorState; remote collaboration updates are not clamped. Deeper indents already in the document are clamped once on registration.

Parameters​

editor​

LexicalEditor

maxIndent?​

number | ReadonlySignal<number | null>

$canIndent?​

CanIndentPredicate | ReadonlySignal<CanIndentPredicate>

Returns​

A cleanup function that unregisters the handler.

() => void