Docs › Text and paragraphs
Lists
Bulleted and numbered lists, nesting, and list styles like a. b. c.
Bulleted and numbered lists for listing things. The listStyle menu changes the markers to a. b. c., i. ii. iii., Korean 가. 나. 다. and more.
Try it
What to bring
- ID card
- Photo
- 3×4 cm
Steps
- Fill in the form
- Hand in papers
- Check the result
Code for this demo
createEditor('#editor', {
toolbar: 'bulletList orderedList listStyle | indent outdent',
});Making lists
bulletListCtrl+Shift+8,orderedListCtrl+Shift+7. Press again to remove the list.- At the start of an empty line, type
-,*or+for bullets,1.or1)for numbers. - Tab nests an item one level deeper, Shift+Tab moves it out. The
indent/outdentbuttons do the same. - Enter on an empty item ends the list.
List style (listStyle)
Choices: ● disc, ○ circle, ■ square, 1. 2. 3., 01. 02., a. b. c., A. B. C., i. ii. iii., I. II. III., 가. 나. 다., ㄱ. ㄴ. ㄷ. A numbered style on a bulleted list turns it into a numbered list and the other way round. Outside a list, it starts a new list in that style.
listMenu puts bullets, numbers and checklist into one menu button, for narrow toolbars.
Presets and phones
bulletListorderedList: first row ofminimal,basic,boardandfulllistStyle: only under ⋯ more infull- On phones bullets are on the main row; numbered lists are under ⋯.
Saved HTML
The default markers (disc, 1. 2. 3.) are saved without a style; others use list-style-type. If your view page CSS resets list-style, the markers may not show.
<ul>
<li>ID card</li>
<li>Photo
<ul><li>3×4 cm</li></ul>
</li>
</ul>
<ol style="list-style-type: lower-alpha">
<li>Fill in the form</li>
</ol>API
editor.exec('bulletList');
editor.exec('listStyle', 'lower-alpha');Options
| Name | Type | Default | Description |
|---|---|---|---|
bulletList | toolbar item | — | Bulleted list |
orderedList | toolbar item | — | Numbered list |
listStyle | toolbar item | — | List style menu |
listMenu | toolbar item | — | Bullets, numbers and checklist in one menu |
markdownShortcuts | boolean | true | Typing - or 1. starts a list |
For to-do lists see Checklists.