Contribute to this guide

guideOrdered and unordered lists

The list feature lets you create ordered (numbered) and unordered (bulleted) lists. You can use ordered lists where the order of the items matters (as in instructions) and unordered lists where it is not that important (as in a list of ingredients).

The regular lists feature will be replaced with the new document lists in the upcoming releases and will be sunset at the beginning of 2024. Consider migrating if you need that functionality. If you wish to switch to the document lists feature, you need to install it first.
See #14767 for more details.

# Demo

Use the editor below to see the list feature in action. You can use toolbar buttons to insert both ordered Insert ordered list and unordered lists Insert unordered list.

You can also use Markdown code recognized by the autoformatting feature:

  • Start a line with * or - followed by a space for a bulleted list.
  • Start a line with 1. or 1) followed by a space for a numbered list.

Ingredients

Ingredients required for making a cup of coffee:

  • 15 g ground coffee
  • water
  • milk (optional)

Instructions

How to prepare a cup of coffee:

  1. Gather the ingredients.
  2. Put 15 g of ground coffee in the cup.
  3. Boil 200 ml of water.
  4. Pour the water into the cup.
  5. Optional: Add milk.

This demo only presents a limited set of features. Visit the feature-rich editor example to see more in action.

After reading this guide, check out the Lists in CKEditor 5 blog post where you will find more information about lists with examples.

# List properties

In addition to the basic functionality of creating the ordered and unordered lists, CKEditor 5 offers formatting tools that let you control the lists. Features such as more styles for list markers, setting the start index, or reversing the list order can be enabled separately or all at once. Check out the individual demos below or see all list properties working together in the full-featured editor example.

The list properties feature is enabled by default in the document editor build only.

The document list properties feature is not available in any builds by default.

See the installation section to learn how to enable these in your editor.

# List styles

The list style feature introduces some more styles for the list item markers. When enabled, it adds 3 styles for unordered lists and 6 styles for ordered lists to choose from. The user will be able to set or change the list style via the dropdown that opens when you click the arrow next to the appropriate list button in the toolbar.

# Demo

In the editor below, use the ordered Insert ordered list or unordered list dropdown Insert unordered list to choose the desired marker type for each list.

Historical and modern manned spacecraft

  1. Soyuz (Soviet/Russian)
    1. The 7K early line (all retired)
      1. 7K-OK
      2. 7KT-OK
      3. 7K-T
      4. 7K-TM
    2. Soyuz T (retired)
    3. Soyuz TM and further modifications (retired)
    4. Soyuz MS
  2. STS orbiter (American; all retired)
    1. Columbia
    2. Challenger
    3. Discovery
    4. Atlantis
    5. Endeavour
  3. SpaceX Crew Dragon (American)
  4. Shenzhou (Chinese)
Items in bold denote craft currently in use as of 2022.

# List start index

The list start index feature allows the user to choose the starting point of an ordered list. By default, this would be 1 (or A, or I – see the list styles section), but in certain situations it may be desired to start a list with some other digit or letter.

When this feature is enabled, an additional dropdown option is available in the ordered list toolbar button. Thanks to it, the user may set or change the starting marker.

# Demo

In the editor below, notice how the ordering continues in the second list. For continuous numbering of spaceships, go to the first item of the last list. Then use the ordered list Insert ordered list dropdown input field to set the start index.

A list of human spacecraft

Soviet and Russian spaceships:

  1. Vostok
  2. Voskhod
  3. Soyuz
  4. Progress (cargo)

American spaceships:

  1. Mercury
  2. Gemini
  3. Apollo
  4. space shuttle
  5. Dragon

Chinese spaceships:

  1. Shenzhou
  2. Tianzhou (cargo)

# Reversed list

The reversed list feature lets the user reverse the numbering order of a list, changing it from ascending to descending. This is especially useful in countdowns and things-to-do lists that need to reproduce steps in a reversed order (for example, in disassembly instructions).

When this feature is enabled, an additional dropdown switch is available in the ordered list toolbar button. Thanks to it, the user may easily reverse the order of a list with a single click.

# Demo

Click the second list and use the ordered list Insert ordered list dropdown switch to choose whether the numbering order should be reversed.

Replacing the screen of your Nintendo Game Boy

Game Boy Color, a spudger and a triwing screwdriver.

Disassembling the console

  1. Remove the game cartridge from the slot. Open the battery compartment and remove the batteries.
  2. Remove the six triwing (Y-type screwdriver needed) screws located at the top and middle of the back case and inside the battery compartment.
  3. Separate the front and back case halves. Be extra careful not to pull the cable ribbon that connects both parts. Detach the ribbon carefully.
  4. Remove the ten Philips screws holding the mainboard to the front case. Carefully take the mainboard out of the case.
  5. Detach three plastic clips on the backside of the board and remove two Philips screws on the front, below the screen.
  6. Desolder the display connectors from the mainboard.

Reassembling the console

  1. Solder the display connector to the mainboard.
  2. Fasten the two screws below the screen and reattach three plastic clips on the backside of the mainboard
  3. Put the mainboard carefully inside the front case and screw in ten Philips screws holding the mainboard.
  4. Reattach the main cable ribbon to the back casing and put the case halves together.
  5. Fasten the six triwing screws inside the battery compartment and on the back of the case.
  6. Reload three AA-size batteries, close the compartment cover, and insert your favorite game cartridge to play!

You can see all the list properties together in action in the Full-featured editor and Document editor examples.

# List indentation

Refer to the Indenting lists section of the Block indentation feature guide.

# Installation

There are currently two plugins providing lists support for CKEditor 5: this regular lists feature and the new document lists feature, based on a different approach.

The lists feature is enabled by default in all predefined builds.

# List feature

To add this feature to your editor, install the @ckeditor/ckeditor5-list package:

npm install --save @ckeditor/ckeditor5-list

Then add the List plugin to your plugin list and the toolbar configuration:

import { List } from '@ckeditor/ckeditor5-list';

ClassicEditor
    .create( document.querySelector( '#editor' ), {
        plugins: [ List, /* ... */ ],
        toolbar: [ 'bulletedList', 'numberedList', /* ... */ ]
    } )
    .then( /* ... */ )
    .catch( /* ... */ );

# List properties

To enable the list properties feature, install the @ckeditor/ckeditor5-list package:

npm install --save @ckeditor/ckeditor5-list

Then add the ListProperties plugin to your plugin list and configure the toolbar. To enable selected sub-features of the list properties, you need to add their configuration to your editor (set true for each feature you want to enable):

import { ListProperties } from '@ckeditor/ckeditor5-list';

ClassicEditor
    .create( document.querySelector( '#editor' ), {
        plugins: [ ListProperties, ... ],
        toolbar: [ 'bulletedList', 'numberedList', ... ],
        list: {
            properties: {
                styles: true,
                startIndex: true,
                reversed: true
            }
        }
    } )
    .then( ... )
    .catch( ... );

Read more about installing plugins.

The ListProperties feature overrides UI button implementations from the ListUI.

These features provide similar functionality:

  • To-do lists – Create a list of interactive checkboxes with labels.
  • Block indentation – Set indentation for text blocks such as paragraphs or headings and lists.
  • Autoformatting – Format the text on the go with Markdown code.

# Common API

The List plugin registers:

The ListProperties plugin registers:

  • The listStyle command that accepts the type of the list style to set. If not set, is uses the default marker (usually decimal).

    editor.execute( 'listStyle', { type: 'lower-roman' } );
    

    The available types are:

    • For bulleted lists: 'disc', 'circle', and 'square'.
    • For numbered lists: 'decimal', 'decimal-leading-zero', 'lower-roman', 'upper-roman', 'lower-latin', and 'upper-latin'.
  • The listStart command which is a Number and defaults to 1 (meaning a list starts with 1). If enabled, it accepts a numerical value for the start attribute.

    editor.execute( 'listStart', { startIndex: 3 } );
    
  • The listReversed command which is a Boolean and defaults to false (meaning the list order is ascending).

    editor.execute( 'listReversed', { reversed: true } );
    
  • The numberedList UI split button that overrides the UI button registered by the List plugin.

  • The bulletedList UI split button that overrides the UI button registered by the List plugin.

# Contribute

The source code of the feature is available on GitHub at https://github.com/ckeditor/ckeditor5/tree/master/packages/ckeditor5-list.