---
title: "HardBreak extension"
description: "Use the Hard Break extension in Tiptap to add support for the HTML tag for line breaks. Learn more in our docs!"
canonical_url: "https://tiptap.dev/docs/editor/extensions/nodes/hard-break"
---

# HardBreak extension

Use the Hard Break extension in Tiptap to add support for the HTML tag for line breaks. Learn more in our docs!

The HardBreak extensions adds support for the `<br>` HTML tag, which forces a line break.

> **Interactive demo:** [HardBreak](https://embed.tiptap.dev/preview/Nodes/HardBreak)

## Install

```bash
npm install @tiptap/extension-hard-break
```

## Settings

### HTMLAttributes

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

```js
HardBreak.configure({
  HTMLAttributes: {
    class: 'my-custom-class',
  },
})
```

### keepMarks

Decides whether to keep marks after a line break. Based on the `keepOnSplit` option for marks.

Default: `true`

```js
HardBreak.configure({
  keepMarks: false,
})
```

## Commands

### setHardBreak()

Add a line break.

```js
editor.commands.setHardBreak()
```

## Keyboard shortcuts

| Command      | Windows/Linux                   | macOS                       |
| ------------ | ------------------------------- | --------------------------- |
| setHardBreak | Shift + Enter + Control + Enter | Shift + Enter + Cmd + Enter |

## Source code

[packages/extension-hard-break/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-hard-break/)
