FeaturesTypography
Horizontal Rule
Insert a thematic break with `setHorizontalRule`.
Type: Node
Horizontal Rule inserts a divider between sections. Renders as <hr> in HTML output.
Demo
Installation
import { HorizontalRule } from "@arkpad/extension-horizontal-rule";Commands
The extension registers one primary command for inserting dividers:
// Inserts a horizontal rule at the current selection
editor.runCommand("setHorizontalRule");Chaining Commands
You can chain commands to insert a horizontal rule and immediately focus the editor:
editor.chain().focus().setHorizontalRule().run();Keyboard Shortcuts
| Shortcut | Action |
|---|---|
Mod-Shift-h | Inserts a horizontal rule |
Markdown Input Rules
Type any of the following shortcuts on a new line to quickly convert it to a divider:
---——___
Active State
const isActive = editor.isActive("horizontalRule");Configuration
Options
| Name | Type | Default | Description |
|---|---|---|---|
HTMLAttributes | Record<string, any> | {} | Key-value pairs of attributes to render on the <hr> DOM element. |
HorizontalRule.configure({
HTMLAttributes: {
class: "custom-divider-styling",
},
});