Lists
DocPayload supports ordered (numbered) and unordered (bulleted) lists. Each list item accepts any content node — paragraphs, headings, tables, columns, images, SVG, even nested lists — and can combine its text with a co-located block (a nested table, columns, or image rendered indented under the item), following HTML5 <li> flow-content semantics. Lists can also be populated dynamically from data.
Ordered lists
Use ol to create a numbered list.
{
"ol": {
"li": [
{ "p": "Verify package dimensions and weight." },
{ "p": "Print the shipping label." },
{ "p": "Drop off at the nearest collection point." }
]
}
}
Unordered lists
Use ul to create a bulleted list.
{
"ul": {
"li": [
{ "p": "Real-time shipment tracking" },
{ "p": "Multi-carrier rate comparison" },
{ "p": "Automated customs documentation" }
]
}
}
Default markers
A list needs no key to get the usual markers. As a browser draws HTML's lists, an ol counts 1. 2. 3., and a ul draws a disc (•) at the top level, a circle (◦) inside one list, and a square (▪) inside two or more, whether the enclosing lists are numbered or bulleted:
{
"document": {
"content": [
{ "ul": { "li": [
{ "p": "disc" },
{ "ul": { "li": [
{ "p": "circle" },
{ "ul": { "li": [ { "p": "square" } ] } }
] } }
] } }
]
}
}
To draw another marker, give the list a style with listStyleType, CSS's key and its counter style names (decimal, lowerAlpha, upperRoman, lowerGreek, disc, circle, square, none and the others), or any other text, drawn as the marker itself:
{
"document": {
"styles": { "articles": { "listStyleType": "upperRoman" } },
"content": [
{ "ol": { "style": "articles", "li": [ { "p": "Definitions" }, { "p": "Term" } ] } }
]
}
}
Properties
| Property | Type | Required | Description |
|---|---|---|---|
ol or ul | object | Yes | The list container |
li | array | Unless source | Array of list item content elements |
symbol | string | No | The marker as a symbol: a numbering symbol counts the items, an image file is every bullet, other text is drawn as is. A style's listStyleType wins over it |
style | string | No | The named style of the list: its markers, its numbering and its items' text |
continues | boolean | No | Continues the previous list of the same kind: the numbering carries on, and the structure tree links the two, so a screen reader hears one interrupted list |
source | string | No | A $data array the items are made from (see Data-driven lists) |
map | string | No | The field, or template, of each source element that becomes its item's text; needs source |
Numbering styles
Control how ordered list items are numbered using the symbol property.
| Symbol | Output | Description |
|---|---|---|
"1" | 1. 2. 3. | Decimal numbers (default) |
"a" | a. b. c. | Lowercase letters |
"A" | A. B. C. | Uppercase letters |
"i" | i. ii. iii. | Lowercase Roman numerals |
"I" | I. II. III. | Uppercase Roman numerals |
"α" | α. β. γ. | Lowercase Greek |
"Α" | Α. Β. Γ. | Uppercase Greek |
"01" | 01. 02. 03. | Decimal with a leading zero |
"א", "Ա", "ա" | א. ב. ג. / Ա. Բ. Գ. / ա. բ. գ. | Hebrew, upper and lower Armenian |
"١", "۱", "१", … | ١. ٢. ٣. | A numeric system's digit one counts in that system's digits (Arabic-Indic, Persian, Devanagari and the other numeric counter styles) |
{
"ol": {
"symbol": "A",
"li": [
{ "p": "First item" },
{ "p": "Second item" },
{ "p": "Third item" }
]
}
}
{
"ol": {
"symbol": "i",
"li": [
{ "p": "Section one" },
{ "p": "Section two" },
{ "p": "Section three" }
]
}
}
Custom bullet symbol
Override the default bullet character for unordered lists using the symbol property. Any string that is not a numbering symbol is drawn as is.
{
"ul": {
"symbol": "-",
"li": [
{ "p": "Chicago hub" },
{ "p": "Denver hub" },
{ "p": "Dallas hub" }
]
}
}
An image file as symbol draws that image, 13pt square, as the bullet of every item, with a space after it:
{
"ul": {
"symbol": "images/check.png",
"li": [
{ "p": "Customs paperwork filed" },
{ "p": "Insurance certificate attached" }
]
}
}
Styling lists
Apply a named style to format all items in a list: write it as the list's own style.
{
"ul": {
"style": "bodyText",
"li": [
{ "p": "Express delivery: 1-2 days" },
{ "p": "Standard delivery: 3-5 days" },
{ "p": "Economy delivery: 7-10 days" }
]
}
}
A style written on the node beside ul, rather than inside it, is the box drawn around the list (its border, background, padding and margins). The list inherits from it only what CSS inherits: a key that is the list's own, such as start, reaches nothing there, and the report says so. Write the list's keys in its own style.
Individual list items can also reference their own styles:
{
"ul": {
"li": [
{ "p": "[b]Express delivery[/b]: 1-2 days", "style": "highlight" },
{ "p": "Standard delivery: 3-5 days" },
{ "p": "Economy delivery: 7-10 days" }
]
}
}
Marker and numbering keys
The list's style decides its markers, as CSS Lists does:
| Style key | Values | Default | What it does |
|---|---|---|---|
listStyleType | a counter style, none, or any other text | decimal on an ol; disc, circle, square as a ul nests | The marker. Text that is not a counter style's name is drawn as is on every item. none draws no marker and keeps the indent |
start | a whole number | 1 | The number the first item carries, as HTML's <ol start>; 0 and negative numbers count too |
prefix | text | none | Drawn before each marker's number |
suffix | text | . after a number, nothing after a bullet | Drawn after each marker's number; "" drops the period. A suffix holds no space of its own: write ") " for a space after the bracket |
listStylePosition | outside, inside | outside | Whether the marker hangs before the item's text or starts its first line |
symbolIndent | points | Space before the marker | |
paddingLeft | points | 30 | The room the markers stand in: where the items' text starts, as HTML's padding-inline-start: 40px (30pt); the text never starts before the widest marker's end. On a right-to-left list, paddingRight is this room and paddingLeft keeps the items off the left |
symbolAlign | start, end | start | Which end the markers line up on: end puts 9. under 10. |
marker | a block of keys | Styles the markers apart from the text (see Styling the marker) |
{
"document": {
"styles": {
"clauses": { "listStyleType": "lowerAlpha", "prefix": "(", "suffix": ") ", "start": 4 },
"articles": { "listStyleType": "upperRoman", "start": 7, "symbolAlign": "end" }
},
"content": [
{ "ol": { "style": "clauses", "li": [ { "p": "The tenant shall keep the premises in repair." }, { "p": "The landlord shall insure the building." } ] } },
{ "ol": { "style": "articles", "li": [ { "p": "Assignment" }, { "p": "Notices" }, { "p": "Governing law" } ] } }
]
}
}
The first list counts (d) (e); the second VII. VIII. IX., the full stops in a column.
Counter styles
Every name listStyleType takes, as CSS Counter Styles names them, in camelCase:
| Kind | Names | Draws |
|---|---|---|
| Decimal | decimal, decimalLeadingZero | 1 2 3 / 01 02 03 |
| Latin letters | lowerAlpha (or lowerLatin), upperAlpha (or upperLatin) | a b c … z aa ab / A B C |
| Roman | lowerRoman, upperRoman | i ii iii / I II III, up to 3999 |
| Greek | lowerGreek, upperGreek | α β γ / Α Β Γ |
| Hebrew, Armenian | hebrew, armenian (or upperArmenian), lowerArmenian | א ב ג / Ա Բ Գ / ա բ գ |
| Numeric scripts | arabicIndic, persian, devanagari, bengali, gujarati, gurmukhi, kannada, malayalam, oriya, tamil, telugu, thai, lao, cambodian (or khmer), myanmar, mongolian, tibetan | the script's own digits: ١ ٢ ٣, ۱ ۲ ۳, १ २ ३, ১ ২ ৩, … |
| Bullets | disc, circle, square | • ◦ ▪ |
A number a counter style cannot write (a Roman numeral past 3999, a letter for 0 or a negative number) is written in decimal, as CSS falls back. A digit or letter the document's fonts lack is drawn from a face the engine ships.
Styling the marker
marker, inside the list's style, styles the markers apart from the item text, as CSS's ::marker. It takes the text keys (color, fontFamily, fontSize, fontWeight, fontStyle, letterSpacing, horizontalScaling) and, beyond CSS, box keys for a shape drawn behind the marker (width, height, padding, border, borderRadius, backgroundColor, clipPath). What it does not state, a marker takes from its item.
{
"document": {
"styles": {
"steps": {
"listStyleType": "decimal",
"suffix": "",
"marker": {
"color": "#FFFFFF",
"fontWeight": "bold",
"fontSize": 9,
"backgroundColor": "#3B4A2F",
"width": 14,
"height": 14,
"borderRadius": 7
}
}
},
"content": [
{ "ol": { "style": "steps", "li": [ { "p": "Book the inspection" }, { "p": "Clear the loading bay" } ] } }
]
}
}
Each number stands white in a 14pt green disc. clipPath cuts the box to any shape ("polygon(50% 0, 100% 50%, 50% 100%, 0 50%)" is a diamond). A marker box taller than the line grows the line. A marker stands on its item's first baseline, level with the words beside it, even when that line holds a raised run such as a footnote call or a superscript. nthChild in the list's style can give some items' markers a marker of their own.
Nested lists
Place a list inside a list item to create multi-level nesting.
{
"ol": {
"li": [
{ "p": "Prepare shipment" },
{
"ul": {
"li": [
{ "p": "Verify dimensions" },
{ "p": "Weigh the package" },
{ "p": "Apply fragile stickers if needed" }
]
}
},
{ "p": "Generate shipping label" },
{ "p": "Schedule pickup" }
]
}
}
Blocks inside a list item
A list item can pair its text with a co-located block — a table, columns, an image, or svg — rendered indented under the item text.
{
"ol": {
"li": [
{
"p": "Summary of charges:",
"table": {
"widths": [3, 1],
"rows": [
[{ "td": "Principal" }, { "td": "$500.00" }],
[{ "td": "Interest" }, { "td": "$45.00" }]
]
}
},
{ "p": "Payment is due within 30 days." }
]
}
}
Child vs. sibling nesting. A nested list on an item that also has text nests under that item (child form — it consumes the parent's ordinal). A Content that is only a ul/ol attaches to the preceding item as a sibling and does not consume an ordinal (HTML list semantics):
{ "ol": { "li": [
{ "p": "Ship order", "ul": { "li": [ { "p": "child — nested under \"Ship order\"" } ] } },
{ "ul": { "li": [ { "p": "sibling — same level, no parent ordinal" } ] } },
{ "p": "Next numbered step" }
] } }
Continuing a list
A list interrupted by a paragraph or a table can carry on counting: write the second part as a list of its own with continues: true.
[
{ "ol": { "li": [ { "p": "Switch off the supply." }, { "p": "Lock the isolator." } ] } },
{ "p": "[b]Warning:[/b] stored energy remains in the capacitors." },
{ "ol": { "continues": true, "li": [ { "p": "Test for dead." }, { "p": "Fit the earth." } ] } }
]
The second list counts 3. 4. In the structure tree the two are linked, so a screen reader announces one list interrupted, not two. A start in the continuing list's style wins over the continuation. A bullet list continues the same way, for the reader's sake.
Lists inside table cells
Lists work inside table cells for structured layouts.
{
"table": {
"widths": [1, 2],
"rows": [
[
{ "p": "[b]Included Services[/b]" },
{
"ul": {
"li": [
{ "p": "Door-to-door delivery" },
{ "p": "Package insurance up to $5,000" },
{ "p": "SMS delivery notifications" }
]
}
}
],
[
{ "p": "[b]Setup Steps[/b]" },
{
"ol": {
"li": [
{ "p": "Create an account" },
{ "p": "Add your warehouse address" },
{ "p": "Configure carrier preferences" }
]
}
}
]
]
}
}
Data-driven lists
Lists can be populated from data arrays using source, in one of two ways: map makes one item of each element, or an li item carrying $item tokens is a template, repeated per element. li may be omitted; literal li items are kept, and the items made by map follow them.
Simple string arrays
When the data source is an array of strings, each string becomes a list item directly:
{
"ul": {
"source": "$data.notes"
}
}
With data { "notes": ["Payment due in 30 days", "Late fees apply", "Contact billing@acme.com"] }, this renders three bullet items.
For ordered lists:
{
"ol": {
"source": "$data.paymentTerms"
}
}
A list's items come from li, from source, or from both:
- Authored — provide
liwith the items you want. - Data-driven — provide
source, and optionallymapto shape each item. Nolineeded; literalliitems written beside it stay first. - Template items — provide
sourceandliitems carrying$itemtokens (see Template items).
symbol works the same way in both modes — set it on the list to pick the marker style (A, a, I, i, 1, custom bullet character, etc.). See Numbering styles for the full set.
$item.* templating in map
map is optional. Without it, a string-array source renders each string as an item directly. Use map when the source is an array of objects and you want to pick fields or compose templates from them:
{
"ul": {
"source": "$data.deliveries",
"map": "$item.date — $item.items ($item.warehouse)"
}
}
With data:
{
"deliveries": [
{ "date": "Jan 15", "items": "Electronics", "warehouse": "Chicago" },
{ "date": "Jan 18", "items": "Furniture", "warehouse": "Denver" }
]
}
This renders:
- Jan 15 — Electronics (Chicago)
- Jan 18 — Furniture (Denver)
Note: for lists, map is one string, not an array as for tables, since each list item is one line: a field name ("map": "date" draws each element's date), or a template holding $item tokens as above.
Template items with $item
The other way to write it, in place of map: an li item carrying $item tokens is a template, drawn once per element of source, where it stands. An item that carries no token is drawn once. A template item is a whole content node, so it can carry a style, a nested list or a table, and a nested list can take its own source from the element.
{
"ol": {
"source": "$data.findings",
"li": [
{
"p": "Finding $item.NUMBER of $item.COUNT: $item.title",
"ul": { "source": "$item.actions" }
}
]
}
}
With data { "findings": [ { "title": "Guard rail loose", "actions": ["Tighten bolts", "Re-inspect in a week"] }, { "title": "Exit sign unlit", "actions": ["Replace lamp"] } ] }, this draws "1. Finding 1 of 2: Guard rail loose" with its two actions under it, then the second finding with one. $item.NUMBER is the element's position from 1 and $item.COUNT how many elements there are. A list gives map or template items, never both: one declaring both is an error.
Complete example: onboarding checklist
Template:
{
"document": {
"styles": {
"title": { "fontSize": 16, "fontWeight": "bold", "marginBottom": 6 },
"section": { "fontSize": 12, "fontWeight": "bold", "marginTop": 12, "marginBottom": 4 }
},
"content": [
{ "p": "Onboarding Checklist — $data.employee.name", "style": "title" },
{ "p": "Start date: $data.employee.startDate" },
{ "p": "Required Training", "style": "section" },
{
"ol": {
"source": "$data.training",
"map": "$item.course — Due by $item.deadline"
}
},
{ "p": "Equipment to Collect", "style": "section" },
{
"ul": { "source": "$data.equipment" }
},
{ "p": "Key Contacts", "style": "section" },
{
"ul": {
"source": "$data.contacts",
"map": "$item.name ($item.role) — $item.email"
}
}
]
}
}
Data:
{
"employee": { "name": "James Walker", "startDate": "March 3, 2026" },
"training": [
{ "course": "Security Awareness", "deadline": "Week 1" },
{ "course": "Code of Conduct", "deadline": "Week 1" },
{ "course": "Platform Overview", "deadline": "Week 2" }
],
"equipment": ["Laptop", "Monitor", "Security badge", "Parking pass"],
"contacts": [
{ "name": "Emily Chen", "role": "Manager", "email": "emily@acme.com" },
{ "name": "David Park", "role": "IT Support", "email": "david@acme.com" },
{ "name": "Rachel Torres", "role": "HR", "email": "rachel@acme.com" }
]
}
Expected result:
Required Training (ordered):
- Security Awareness — Due by Week 1
- Code of Conduct — Due by Week 1
- Platform Overview — Due by Week 2
Equipment to Collect (unordered, simple strings):
- Laptop
- Monitor
- Security badge
- Parking pass
Key Contacts (unordered, $item.* composed):
- Emily Chen (Manager) — emily@acme.com
- David Park (IT Support) — david@acme.com
- Rachel Torres (HR) — rachel@acme.com
See Data Source for more on data-driven content.
Lists across pages
A list item runs on across a page break like any text: its lines continue at the top of the next page, and a nested list keeps counting there. breakInside: "avoid" on the list's style keeps the whole list on one page when it fits on one. A list in a table cell breaks with the table, between its rows. The box a style beside the list draws (a border, a background) is left open at the break; with boxDecorationBreak: "clone" each page's piece is closed, padded and rounded (see A box across a break). See Page breaks.
In DOCX
The Word output writes each list as numbering Word counts itself, one level per list, with the same counter style, start, prefix, suffix, listStylePosition and symbolAlign; a continued list carries on its count, and Greek markers are written as text. A list item that is a table or a picture has its marker beside it, at the item's text edge.
Word's numbering has no form for some markers, and the engine never fakes one with hand-drawn numbers, which would break renumbering when the document is edited. What Word cannot carry is reported:
- The
markerblock's box size and shape (width,height,borderRadius,clipPath): Word draws a shaded rectangle hugging the number, and keeps its automatic numbering. - An image bullet is one picture bullet, which Word sizes itself and draws larger than the PDF's 13pt.
Inline formatting in list items
List items support the full range of inline formatting tags.
{
"ul": {
"li": [
{ "p": "[color, #27AE60][b]Active[/b][/color] -- Chicago Distribution Center" },
{ "p": "[color, #E74C3C][b]Offline[/b][/color] -- Seattle Warehouse" },
{ "p": "[color, #F39C12][b]Maintenance[/b][/color] -- Dallas Sorting Facility" }
]
}
}