tiptap/docs/api/nodes/horizontal-rule.md
2021-11-09 11:56:27 +01:00

1.3 KiB
Raw Blame History

description icon
Separate what needs to be separated, but use it wisely. separator

HorizontalRule

Version Downloads

Use this extension to render a <hr> HTML tag. If you pass <hr> in the editors initial content, itll be rendered accordingly.

Type three dashes (---) or three underscores and a space (___ ) at the beginning of a new line and it will magically transform to a horizontal rule.

Installation

npm install @tiptap/extension-horizontal-rule

Settings

HTMLAttributes

Custom HTML attributes that should be added to the rendered HTML tag.

HorizontalRule.configure({
  HTMLAttributes: {
    class: 'my-custom-class',
  },
})

Commands

setHorizontalRule()

Create a horizontal rule.

editor.commands.setHorizontalRule()

Source code

packages/extension-horizontal-rule/

Usage

https://embed.tiptap.dev/preview/Nodes/HorizontalRule