Scrivr
API ReferenceCore Nodes

List

Bullet and ordered lists — toggleBulletList, toggleOrderedList, indent, and dedent.

Provides bullet lists, ordered lists, and list items. All three node types (bulletList, orderedList, listItem) are registered by a single List extension.

import { List } from '@scrivr/core';

No configurable options.


Nodes

NodeContentDescription
bulletListlistItem+Unordered list container.
orderedListlistItem+Ordered list container. Has an order attribute (default 1) for the starting number.
listItemparagraph block*A single list item. The first child must be a paragraph; subsequent children can be any block (for nested content).

Commands

CommandDescription
toggleBulletList()Wraps selection in a bullet list, lifts it out, or converts from ordered — mirrors Google Docs behaviour.
toggleOrderedList()Same toggle logic for ordered lists.
liftListItem()Dedents the current list item (or exits the list if at top level).
sinkListItem()Indents the current list item one level deeper.

Keyboard

KeyAction
Mod-Shift-8Toggle bullet list
Mod-Shift-9Toggle ordered list
EnterSplit list item. Exits the list when the item is empty.
TabIndent list item deeper.
Shift-TabDedent list item.

Input rules

PatternResult
- or * at start of blockWraps in a bullet list.
1. at start of blockWraps in an ordered list starting at that number.

On this page