1.6 KiB
1.6 KiB
Heading
The Heading extension adds support for headings of different levels. Headings are rendered with <h1>, <h2>, <h3>, <h4>, <h5> or <h6> HTML tags. By default all six headline levels are enabled, but you can pass an array to only allow a few levels. Check the usage example to see how this is done.
Type # at the beginning of a new line and it will magically transform to a headline, same for ## , ### , #### , ##### and ###### .
Installation
# With npm
npm install @tiptap/extension-heading
# Or: With Yarn
yarn add @tiptap/extension-heading
Settings
| Option | Type | Default | Description |
|---|---|---|---|
| class | string | – | Add a custom class to the rendered HTML tag. |
| levels | Array | [1, 2, 3, 4, 5, 6] | Specifies which headlines are supported. |
Commands
| Command | Options | Description |
|---|---|---|
| heading | level | Creates a heading node. |
Keyboard shortcuts
ControlShift1→ H1ControlShift2→ H2ControlShift3→ H3ControlShift4→ H4ControlShift5→ H5ControlShift6→ H6