Skip to main content
The ListItem extension represents individual items within bullet lists and ordered lists. It’s required for both BulletList and OrderedList extensions to function properly.

Installation

Usage

The ListItem extension is included in the StarterKit by default:
To use it standalone with list extensions:

Configuration

HTMLAttributes

Custom HTML attributes to add to the list item element.
Record<string, any>
default:"{}"
Custom HTML attributes that should be added to the rendered HTML tag.

bulletListTypeName

The node type name for bullet list nodes.
string
default:"'bulletList'"
Specifies which node type represents bullet lists.

orderedListTypeName

The node type name for ordered list nodes.
string
default:"'orderedList'"
Specifies which node type represents ordered lists.

Keyboard Shortcuts

  • Enter: Split the current list item into two
  • Tab: Sink the list item (indent/nest it)
  • Shift-Tab: Lift the list item (outdent/unnest it)

Content Structure

A list item contains:
  • One paragraph (required)
  • Zero or more additional block-level nodes (optional)
This allows for complex list items with multiple paragraphs or nested lists:

Source Code

View the source code on GitHub: packages/extension-list/src/item/list-item.ts