Find out what's new in Tiptap V3

BulletList extension

VersionDownloads

This extension enables you to use bullet lists in the editor. They are rendered as <ul> HTML tags. Type * , - or + at the beginning of a new line and it will magically transform to a bullet list.

Modify backspace behavior

If you want to modify the standard behavior of backspace and delete functions for lists, you should read about the ListKeymap extension.

Install

npm install @tiptap/extension-list

This extension requires the ListItem node.

Usage

import { Editor } from '@tiptap/core'
import { BulletList } from '@tiptap/extension-list'

new Editor({
  extensions: [BulletList],
})

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

import { Editor } from '@tiptap/core'
import { ListKit } from '@tiptap/extension-list-kit'

new Editor({
  extensions: [ListKit],
})

Settings

HTMLAttributes

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

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

itemTypeName

Specify the list item name.

Default: 'listItem'

BulletList.configure({
  itemTypeName: 'listItem',
})

keepMarks

Decides whether to keep the marks from a previous line after toggling the list either using inputRule or using the button

Default: false

BulletList.configure({
  keepMarks: true,
})

keepAttributes

Decides whether to keep the attributes from a previous line after toggling the list either using inputRule or using the button

Default: false

BulletList.configure({
  keepAttributes: true,
})

Commands

toggleBulletList()

Toggles a bullet list.

editor.commands.toggleBulletList()

Keyboard shortcuts

CommandWindows/LinuxmacOS
toggleBulletListControl + Shift + 8Cmd + Shift + 8

Source code

packages/extension-list/src/bullet-list/

Minimal Install

import { Editor } from '@tiptap/core'
import { BulletList } from '@tiptap/extension-list/bullet-list'

new Editor({
  extensions: [BulletList],
})