Extensions
Indent / Outdent
Increase or decrease text indentation.
The IndentOutdent extension adds indent and outdent buttons to the toolbar. Indentation is applied as text-indent CSS, with a configurable size and maximum level.
Import
import { IndentOutdent } from 'ritext/extension/indentoutdent';Usage
const extensions = [IndentOutdent];Configuration
IndentOutdent.configure({
indentSize: 1,
maxIndent: 7,
types: ['paragraph', 'heading', 'blockquote'],
})Options
Prop
Type
Keyboard Shortcuts
| Action | Windows / Linux | macOS |
|---|---|---|
| Indent | Tab | Tab |
| Outdent | Shift+Tab | Shift+Tab |
The Tab/Shift+Tab shortcuts only apply inside paragraphs, headings, and blockquotes — not inside lists. Inside lists, Tab/Shift+Tab control list nesting (via ListKeymap).
How Indentation Works
Each indent level adds 2em of text-indent. The maximum is 7 levels (14em). The indent level is stored as a data-indent attribute on the node.
