MDX Notes
Bullet points, numbered lists, nested lists, and task checklists in MDX. All the list types you
Lists are everywhere in technical documentation — feature descriptions, step-by-step instructions, comparison points, requirements, and checklists. In MDX, lists work exactly like standard Markdown lists with no additional syntax to learn. But understanding the nuances of nesting, mixed lists, and multi-line items will help you write cleaner, more readable content.
Numbered Lists (Ordered Lists)
Use any number followed by a period and a space. The actual numbers you write do not matter — MDX will number them sequentially in the output.
1. Write the content
2. Add components
3. Run the build
4. Deploy the site1. Write the content 2. Add components 3. Run the build 4. Deploy the site
Interesting behavior: You could write 1. 1. 1. 1. for all items and the output would still be 1. 2. 3. 4. — Markdown auto-numbers them. However, writing correct numbers makes your source file easier to read when editing.
Starting from a different number: In some parsers, the first number determines the starting point. So 3. First item would start numbering from 3. This behavior varies between Markdown implementations.
When to use numbered lists: Use them for step-by-step instructions, procedures, rankings, or anything where the order matters. If someone could reasonably follow the items in a different order, bullet points are more appropriate.
Nested Lists
Indent with 2 or 4 spaces (depending on your parser configuration) to create sub-items:
- Frontend Technologies
- React
- Vue
- Svelte
- Angular
- Backend Technologies
- Node.js
- Python
- Go
- Rust
- Databases
- PostgreSQL
- MongoDB
- Redis • Frontend Technologies
• React
• Vue
• Svelte
• Angular
• Backend Technologies
• Node.js
• Python
• Go
• Rust
• Databases
• PostgreSQL
• MongoDB
• RedisYou can nest as deep as you want, but 3 levels is the practical maximum before content becomes hard to read, especially on mobile devices. If you need deeper nesting, consider restructuring your content with headings and separate lists.
Indentation consistency matters. Use the same number of spaces for all nested items. Mixing 2-space and 4-space indentation in the same document causes unpredictable parsing behavior.
Mixed Lists (Ordered + Unordered)
You can combine ordered and unordered lists when nesting:
1. Set up your project
- Install Node.js 18 or higher
- Create a new directory
- Run `npm init -y`
2. Install dependencies
- `@mdx-js/mdx` — the core compiler
- `@mdx-js/react` — React integration
- `gray-matter` — frontmatter parsing
3. Start writing MDX files
- Create `src/content/` directory
- Add your first `.mdx` file
- Import and render it in a pageThis pattern is extremely common in tutorials: numbered steps provide the overall sequence, and bullet points within each step list the specific sub-tasks that can be done in any order.
Task Lists (Checklists)
Use - [ ] for unchecked and - [x] for checked items:
☑ Write introduction ☑ Add code examples ☑ Create diagrams ☐ Record video tutorial ☐ Publish to production ☐ Announce on social media
These render as actual checkboxes on most platforms including GitHub, GitLab, and MDX-powered sites. They are excellent for:
- Project progress tracking in documentation
- Release checklists
- Setup requirement verification
- Todo items within tutorials
- Feature completion status
Note: In most MDX sites, task list checkboxes are read-only in the rendered output. They display the state defined in your source file but cannot be toggled by the reader (unlike GitHub Issues where they are interactive).
Multi-Line List Items
When a list item needs multiple paragraphs or complex content, indent the continuation with the same indentation as the list item text:
- **First step:** Install all the required packages for the project.
Make sure you are using Node 18 or higher. Older versions
might cause compatibility issues with MDX v3. You can check
your version with `node --version`.
- **Second step:** Configure your bundler settings.
This varies depending on whether you are using webpack,
Vite, or another build tool. Check the framework-specific
documentation for exact configuration.
- **Third step:** Create your content directory structure.
We recommend `src/content/` as the base directory with
subdirectories for each content type (blog, docs, guides).The blank line plus indentation tells the parser "this paragraph belongs to the list item above." Without proper indentation, the paragraph breaks out of the list and starts a new block.
Lists with Code Blocks
Including code blocks inside list items requires careful indentation:
The code block must be indented to align with the list item content (typically 3-4 spaces after the number and period).
Definition Lists (Not Standard but Useful)
Standard Markdown does not support definition lists, but some MDX configurations with plugins enable them:
MDX
: A format that combines Markdown with JSX components
Remark
: A Markdown processor built on the unified ecosystem
Rehype
: An HTML processor that works alongside remarkIf your MDX setup does not support definition lists, you can achieve a similar effect with bold terms and indented descriptions using regular lists.
When to Use Which List Type
| List Type | Use When | Example |
|---|---|---|
| Bullet points | Items have no particular order | Features, options, examples |
| Numbered lists | Order matters (steps, rankings) | Tutorials, procedures, priorities |
| Task lists | Tracking completion status | Checklists, requirements, progress |
| Nested lists | Items have subcategories | Hierarchical data, grouped options |
| Mixed lists | Steps with unordered sub-items | Tutorials with flexible sub-tasks |
Common Mistakes
- Forgetting the space after the marker —
-itemis not a list,- itemis - Inconsistent indentation — mixing 2-space and 4-space nesting causes parsing issues
- Missing blank lines around lists — always leave blank lines before and after a list
- Mixing markers in one list — pick
-or*and stick with it - Over-nesting — more than 3 levels deep is a sign you need restructuring
- Using bullet points for ordered steps — if sequence matters, use numbers
- Starting numbered lists without context — always introduce what the list contains
Tips for Better Lists
- Keep list items parallel in structure. If one item starts with a verb, all items should start with verbs. If one is a noun phrase, all should be noun phrases.
- Keep items concise. If each item is 3+ sentences, consider using headings with paragraphs instead.
- Introduce every list. Tell the reader what the list contains before presenting it: "Here are the required dependencies:" followed by the list.
- Do not end list items with periods unless they are complete sentences. Short phrases do not need punctuation.
- Use bold for key terms at the start of descriptive list items to make them scannable.
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Lists in MDX.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this MDX Tutorial topic.
Search Terms
mdx-tutorial, mdx tutorial, mdx, tutorial, basics, lists, lists in mdx
Related MDX Tutorial Topics