---
title: "Line Height extension"
description: "Add text line-height support to your Tiptap editor with the Line Height extension. Learn more in our documentation."
canonical_url: "https://tiptap.dev/docs/editor/extensions/functionality/line-height"
---

# Line Height extension

Add text line-height support to your Tiptap editor with the Line Height extension. Learn more in our documentation.

This extension enables you to set the *line height* in the editor. It uses the [`TextStyle`](https://tiptap.dev/docs/editor/extensions/marks/text-style.md) mark, which renders a `<span>` tag (and only that). The line height is applied as inline style then, for example `<span style="line-height: 1.5">`.

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

## Install

```bash
npm install @tiptap/extension-text-style
```

This extension requires the [`TextStyle`](https://tiptap.dev/docs/editor/extensions/marks/text-style.md) mark.

```ts
import { Editor } from '@tiptap/core'
import { TextStyle, LineHeight } from '@tiptap/extension-text-style'

new Editor({
  extensions: [TextStyle, LineHeight],
})
```

This extension is installed by default with the `TextStyleKit` extension, so you don’t need to install it separately.

```ts
import { Editor } from '@tiptap/core'
import { TextStyleKit } from '@tiptap/extension-text-style'

new Editor({
  extensions: [TextStyleKit],
})
```

## Settings

### types

A list of marks to which the lineHeight attribute should be applied to.

Default: `['textStyle']`

```js
LineHeight.configure({
  types: ['textStyle'],
})
```

## Commands

### setLineHeight()

Applies the given line height as inline style.

```js
editor.commands.setLineHeight('1.1')
```

### unsetLineHeight()

Removes any line height.

```js
editor.commands.unsetLineHeight()
```

## Source code

[packages/extension-text-style/src/line-height/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-text-style/src/line-height/)

## Minimal Install

```js
import { Editor } from '@tiptap/core'
import { LineHeight } from '@tiptap/extension-text-style/line-height'

new Editor({
  extensions: [LineHeight],
})
```
