The task list tool (Ctrl+Shift+9) turns the selected lines into tasks, each with a checkbox in place of its bullet, and turns them back. Typing [ ] or [x] at the start of a line also starts a task, the second one already done.
A click on a box checks it, and so does Ctrl+Enter with the caret in the task. Enter starts the next task, and Enter in an empty task ends the list. Tasks nest and indent like other list items.
The value holds each task as GitHub-flavored Markdown renders it, <li><input type="checkbox" disabled checked>, so task lists from GitHub or Markdig keep their boxes when they're pasted or bound. RichText shows the boxes read-only. In both, each box is named by its task's text for screen readers.
A release checklist
Tick a task, then see the same value in RichText below the editor.
Static
Preview
Version 2.4
- Merge the payment fixes
- Update the pricing page
- Write the release notes
- New features
- Breaking changes
- Brief the support team
Version 2.4
- Merge the payment fixes
- Update the pricing page
- Write the release notes
- New features
- Breaking changes
- Brief the support team
Code
@* A release checklist: tick a task with a click or Ctrl+Enter, and RichText shows the same
value with its boxes read-only. *@
<Stack Gap="6" Grow>
<RichTextEditor @bind-Value="_checklist" Label="Release checklist" Rows="8" />
@* A labeled line, not a card: RichText draws no box of its own. *@
<Divider Label="As RichText shows it" />
<RichText Html="_checklist" />
</Stack>
{
private string? _checklist =
"""
<h3>Version 2.4</h3>
<ul>
<li><input type="checkbox" disabled checked>Merge the payment fixes</li>
<li><input type="checkbox" disabled checked>Update the pricing page</li>
<li><input type="checkbox" disabled>Write the release notes
<ul>
<li><input type="checkbox" disabled checked>New features</li>
<li><input type="checkbox" disabled>Breaking changes</li>
</ul>
</li>
<li><input type="checkbox" disabled>Brief the support team</li>
</ul>
""";
}