Skip to main content
The OrderedList extension allows you to create ordered numbered lists. It requires the ListItem extension to function properly and supports custom start numbers.

Installation

Usage

The OrderedList extension is included in the StarterKit by default:
To use it standalone:

Configuration

itemTypeName

The node name for list items.
string
default:"'listItem'"
Specifies which node type to use for list items.

HTMLAttributes

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

keepMarks

Keep marks when splitting the list.
boolean
default:"false"
Whether to preserve text marks when creating new list items.

keepAttributes

Keep attributes when splitting the list.
boolean
default:"false"
Whether to preserve attributes when creating new list items.

Attributes

The OrderedList node supports the following attributes:

start

The starting number for the list.

type

The list marker type (e.g., ‘1’, ‘a’, ‘A’, ‘i’, ‘I’).

Commands

toggleOrderedList

Toggles an ordered list. If the current node is already an ordered list, it converts it to paragraphs.

Keyboard Shortcuts

  • Mod-Shift-7: Toggle ordered list

Input Rules

The OrderedList extension supports Markdown-style input rules:
  • Type 1. followed by a space to create an ordered list
  • Type any number followed by . and a space (e.g., 5.) to create a list starting at that number

Source Code

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