Overview
The Checklist plugin enables users to create interactive task lists and checklists within the editor. Users can check/uncheck items, reorder them, and maintain a visual representation of task completion status.
Features
- ✓ Interactive checkboxes
- ✓ Drag-and-drop reordering
- ✓ Nested checklist support
- ✓ Completion progress tracking
- ✓ Keyboard shortcuts
- ✓ Customizable styling
- ✓ Export checklist status
- ✓ Undo/redo support
Installation
npm install @editora/plugin-checklist
Basic Usage
import Editora from '@editora/core';
import ChecklistPlugin from '@editora/plugin-checklist';
const editor = new Editora('#editor');
editor.use(ChecklistPlugin);
// Insert a checklist
editor.execCommand('insertChecklist');
Creating Checklists
There are several ways to insert checklists:
- Toolbar Button: Click the checklist icon in the toolbar
- Command: Use the insertChecklist command
- Keyboard: Press Ctrl+Shift+L (or Cmd+Shift+L on Mac)
- Typing: Start a line with "- [ ]" and press Enter
Configuration Options
| Option | Type | Description |
|---|---|---|
| allowNesting | boolean | Allow nested checklists (default: true) |
| dragAndDrop | boolean | Enable drag-and-drop reordering (default: true) |
API Methods
- insertChecklist(): Insert a new checklist
- toggleChecklistItem(): Toggle checkbox state
- getChecklistProgress(): Get completion percentage
Tips & Tricks
- Quick Tasks: Type "- [ ]" at the start of a line for instant checklist items
- Bulk Toggle: Select multiple items and toggle all at once
- Nested Lists: Press Tab to indent and create nested checklists
- Progress Tracking: Use the progress bar to see task completion at a glance