Task Lists in Markdown
Task lists are used to create interactive lists with checkable items. They are ideal for tracking progress, creating a to-do list, and project planning.
Basic task list syntax
Task lists are created by using a hyphen/dash and square brackets with either a space for incomplete tasks or an x
for completed tasks. This is followed by the task description.
Syntax:
- [ ] Incomplete task
- [x] Completed task
Result:
- Incomplete task
- Completed task
Nesting task lists
You can create a nested task lists by indenting items:
Syntax:
- [ ] Task 1
- [x] Nested task 1.1
- [x] Nested task 1.2
- [ ] Task 2
- [ ] Nested task 2.1
Result:
- Task 1
- Nested task 1.1
- Nested task 1.2
- Task 2
- Nested task 2.1
Combining with other list types
Task lists can be combined with ordered lists:
1. [ ] First ordered task
2. [x] Second ordered task
* [ ] Unordered subtask
* [x] Another unordered subtask
3. [ ] Third ordered task
Task list formatting
Task descriptions can include Markdown syntax such as code, links, and text formatting:
Syntax:
- [x] Visit our [Markdown course](/course/markdown/introduction-to-markdown/introduction-to-markdown) to get started.
- [ ] *Either* complete the course in order, or choose which lessons you require.
- [ ] Use a **task list** to track your progress.
Result:
- Visit our Markdown course to get started.
- Either complete the course in order, or choose which lessons you require.
- Use a task list to track your progress.
HTML equivalent
If your Markdown processor does not support task lists, you can use HTML as a fallback:
<ul>
<li><input type="checkbox" checked> Completed task</li>
<li><input type="checkbox"> Incomplete task</li>
</ul>
Result:
- Completed task
- Incomplete task