
Total Views
40
Read Time
38 min read
Updated On
16.09.2026
Introduction
How to Add Comments & Annotations to a React Rich Text Editor 2026
Add comments & annotations to any React rich text editor in 2026. Working code for Lexical, TipTap with threaded discussions, resolve/reopen, mentions, and multi-author attribution. Eddyter in 10 min.
TL;DR
Comments in React editors 2026: highlight text, add threaded discussion, resolve/reopen. Custom build 2-4 wks + $15K-$35K. CKEditor $144-$864/mo today. Eddyter Q4 2026 native at $12-$59/mo flat + AI.

Content
How to Add Comments & Annotations to a React Rich Text Editor 2026
Learning how to add comments to a React rich text editor is one of the highest-impact features you can ship in 2026. Google Docs made inline comments universal. Notion made threaded discussions expected. Figma made real-time annotation collaborative. Every modern content editor now needs the same pattern — highlight text, drop a comment, thread replies, resolve when done. Users notice the moment it's missing.
Building it is harder than it looks. Naive implementations lose comment anchors when users edit the surrounding text. Threaded replies pile up without resolution UI. Notifications never fire. Multi-user attribution breaks when authors disconnect mid-thread. And custom builds routinely take 2-4 weeks of engineering time when the plumbing goes wrong.
This guide shows you exactly how to add comments to a React rich text editor in 2026 — the full annotation pattern with threaded discussions, resolve/reopen controls, @mentions inside comments, and persistent storage. You'll get four working paths: custom Lexical build, custom TipTap build, CKEditor 5 Comments (available today), and Eddyter native comments (Q4 2026 launch).
The short answer: For most React and Next.js teams needing to add comments to a React rich text editor in 2026, the fastest production path today is CKEditor 5 Comments plugin ($144-$864/mo Cloud + $99+/mo AI). For flat pricing plus AI, wait for Eddyter native comments (Q4 2026 launch at $59/mo). For total UX control, custom builds in Lexical or TipTap take 2-4 weeks at $15K-$35K.
🎥 New to modern editors? Watch: What is Eddyter? Why Developers Are Switching in 2026
What Comments & Annotations Actually Mean
Before writing code, clarify what pattern you need. "Comments and annotations" describes six related features:
1. Text Anchoring
Users select text and drop a comment. The comment stays anchored to that specific text even when surrounding content changes. If someone deletes the anchored text, the comment shows as "orphaned" — not lost.
2. Threaded Discussions
Each comment supports replies. Replies to replies form a thread. Threads have a chronological order. Users can see who said what when.
3. Resolve/Reopen Controls
Comments have status: open or resolved. Reviewers resolve threads when the issue is fixed. Any author can reopen a resolved thread if needed.
4. Author Attribution
Every comment and reply shows the author's name, avatar, and timestamp. Multi-user editing shows distinct authors clearly.
5. @Mentions Inside Comments
Comments themselves need @ mention support to loop in specific users. This connects comment discussion to notifications.
6. Notification Delivery
When someone gets mentioned in a comment, they get notified. When someone replies to your thread, you get notified. When your comment is resolved, you get notified.
This guide covers all six. Building comments without any one of them creates a broken review workflow.
The 7 Technical Challenges of Building Comments
Comments look simple but hide substantial complexity:
1. Anchor Persistence Across Edits
Comment anchored to characters 100-120. User inserts 5 characters at position 50. Anchor must shift to 105-125 automatically. This is hard.
2. Anchor Behavior on Deletion
Comment anchored to text "urgent action needed". User deletes half the text to "urgent action". Comment should still work — showing what remains, or marking orphaned.
3. Rendering Comment Threads
Threads live in a sidebar or popover. Clicking a highlighted comment in the editor scrolls to the thread. Clicking a thread highlights the comment in the editor. Bidirectional interaction requires careful state.
4. Multi-User Comment Collaboration
Two users add comments simultaneously. Both persist. Two users reply to the same thread simultaneously. Both replies land in order. Requires CRDT logic for real-time editing.
5. Comment State Persistence
Comments live in your backend. Every reply, resolve, reopen action needs API calls. Debounce writes. Handle offline gracefully.
6. @Mention Notification Wiring
@ in a comment textbox needs its own autocomplete (usually different from editor-level @mentions). Notifications fire on comment save.
7. Comment Search & Filtering
Products with 100+ comments need filters: my comments, unresolved only, mentioned me, comments by author. Requires backend queries.
For deeper editor patterns, see our How to Add @Mentions to a React Rich Text Editor 2026 and How to Add Track Changes to a React Rich Text Editor 2026.
Four Paths: Custom, CKEditor Today, or Eddyter Q4 2026
You have four production paths in 2026:
Approach | Setup Time | Available | 3-Year Cost | Best For |
|---|---|---|---|---|
Custom Lexical build | 2-4 weeks | Today | $15,000-$35,000+ | Teams with specific comment UX requirements |
Custom TipTap build | 2-4 weeks | Today | $15,000-$35,000+ | Teams already on TipTap |
CKEditor 5 Comments plugin | 4-6 hours | Today | $10,000-$34,000 | Enterprise teams shipping this quarter |
Eddyter native comments | 10 minutes | Q4 2026 | $2,124 | Teams building for late 2026 or 2027 launch |
Both custom paths give total control. CKEditor 5 ships today. Eddyter combines comments with AI at flat pricing when it launches.
Path 1: Custom Build in Lexical (2-4 Weeks)
If you need full control over comment UX, this is the pattern that works in 2026 with Lexical.
Step 1: Install Dependencies
bash
Step 2: Define the Comment Data Model
Every comment needs consistent data:
typescript
What this defines:
CommentThread— the top-level comment with anchor positionCommentReply— chronological replies inside a threadanchorTextsnapshot — preserves context even if source text is editedstatus— open or resolved for review workflowmentions— user IDs mentioned for notification wiring
Step 3: Create the Comment Anchor Node
Custom Lexical node that renders inline highlighting for commented text:
typescript
Step 4: CSS for Comment Highlighting
css
Step 5: Build the Comment Plugin
Handle text selection and comment creation:
tsx
What this plugin does:
- Detects text selection
- Shows "Add comment" button above selected text
- Prompts for comment text on click (in production, use a proper form)
- Creates a
CommentAnchorNodewrapping the selected text - Notifies parent component of new thread
Step 6: Comment Thread Sidebar Component
tsx
What this sidebar does:
- Shows filtered comment threads (open, resolved, or all)
- Each thread displays author avatar, timestamp, and anchor text preview
- Replies chronologically shown
- Reply input for open threads
- Resolve/reopen buttons
- Auto-scrolls when comment anchor is clicked in editor
- Highlighted state for selected thread
Step 7: Wire Everything Up
tsx
That's the full custom Lexical implementation. Select text. Click "Add comment." Thread appears in sidebar. Reply. Resolve. Reopen. Persistent via backend.
What This Custom Build Doesn't Cover
The 400+ lines above handle the core pattern. Production comments still need:
- Anchor persistence when surrounding text is edited (~1 week)
- Real-time collab with Y.js awareness for multi-user (~1 week)
- Backend API + storage for threads + replies (~3-5 days)
- Notification service integration (~2-3 days)
- @mentions inside comments with autocomplete (~3-5 days)
- Comment search & filtering at scale (~3-5 days)
- Rich text inside comments (~3-5 days)
Total production-quality custom Lexical comments: 2-4 weeks of senior engineering time, roughly $12K-$24K in senior engineering salary alone, plus ongoing maintenance costs.
The Real Cost of Custom Lexical Comments
Production-quality comments built this way typically costs:
Item | Cost |
|---|---|
Senior engineering (2-4 weeks @ $150/hr, 40hrs/wk) | $12,000-$24,000 |
Backend for threads/replies persistence | $3,000-$6,000 |
Notification service integration | $2,000-$4,000 |
Y.js collab integration for multi-user comments | $5,000-$10,000 |
Ongoing maintenance (edge cases, performance) | $5,000-$10,000/yr |
3-year total | $37,000-$74,000+ |
For build-vs-buy analysis, see Build vs Buy: Real Cost of Building a Rich Text Editor 2026 and Why Building Your Own Rich Text Editor Is a Startup Killer.
Path 2: Custom Build in TipTap (2-4 Weeks)
If you're already on TipTap, use the community @tiptap-pro/extension-comment (part of TipTap's paid Pro tier) or build a custom Mark-based approach.
Basic Custom Approach with Mark Extension
typescript
Then handle selection detection, thread management, and sidebar rendering using the same patterns as Path 1 (adapted for TipTap's editor API instead of Lexical's).
For managed TipTap comments, use @tiptap-pro/extension-comment (part of TipTap Cloud paid plans starting at $49-$999/mo + AI Toolkit costs).
For deeper analysis, see TipTap Pricing Explained 2026 and Best TipTap Alternatives 2026.
Path 3: CKEditor 5 Comments (Available Today)
CKEditor 5 has the strongest production comments today. It ships as a paid plugin bundled with CKEditor 5 Cloud plans.
Basic Setup
tsx
CKEditor 5 Comments Strengths
- ✅ Available today — production ready in 2026
- ✅ Full feature set — threads, replies, resolve/reopen, @mentions
- ✅ Author attribution — multi-user with distinct avatars
- ✅ Sidebar UI — polished right out of the box
- ✅ Real-time collaboration — works with CKEditor 5 collab
- ✅ Backend adapter API — connect to your own comment storage
- ✅ SOC 2 Type II and HIPAA compliance support
CKEditor 5 Comments Limitations
- ❌ Complex commercial licensing starting at $144/mo Cloud
- ❌ AI Assistant costs extra ($99+/mo)
- ❌ Combined pricing can hit $1,000-$1,500/mo for full AI + collab + comments
- ❌ Heavy bundle (~500 KB) hurts Core Web Vitals
- ❌ Setup complexity — 4-6 hours vs Eddyter's 10 minutes
For comparisons, see Eddyter vs CKEditor 2026 and Best CKEditor Alternative 2026.
Best for: Enterprise teams needing comments in production today with budget for CKEditor licensing.
Path 4: Eddyter Native Comments (Q4 2026 Launch)
Eddyter's native comments launches Q4 2026 — Lexical-powered under the hood, but zero configuration on your side.
What Eddyter Comments Will Deliver (Anticipated)
- ✅ 10-minute setup — same 3-step integration as base Eddyter
- ✅ Threaded comments with replies — sidebar included, no custom code
- ✅ Multi-model AI + comments in one product (unique combination)
- ✅ @mentions inside comments with autocomplete
- ✅ Resolve/reopen workflow — built-in state management
- ✅ 7-framework support — React, Next.js, Vue 3, Angular 17-20, Svelte 4/5, Laravel, Vanilla JS
- ✅ Flat pricing — included in AI Pro Managed ($59/mo) tier
- ✅ Notification webhooks — same pattern as @mentions webhook
- ✅ Y.js-based collaboration compatibility (Q3 2026 launch)
Anticipated Setup Pattern (Post-Q4 2026 Launch)
tsx
Comments. Real-time collab (Q3 2026). Multi-model AI (GPT-5, Claude Sonnet 5, Haiku 4.5, Gemini 3). Track changes (Q4 2026). All in one editor at $59/mo flat.
Get your Eddyter API key from eddyter.com/user/license-key. Watch the Q4 2026 launch for comments availability.
🎥 See real Eddyter setup: Integrate Eddyter in 30 Minutes with Cursor, Claude, Lovable
Full Comparison: All 4 Paths
Feature | Custom Lexical/TipTap | CKEditor 5 (Today) | Eddyter (Q4 2026) |
|---|---|---|---|
Setup time | 2-4 weeks | 4-6 hours | 10 minutes |
Available today | ✅ Yes | ✅ Yes | ❌ Q4 2026 |
Threaded discussions | Build custom | ✅ Native | ✅ Native |
Resolve/reopen | Build custom | ✅ Native | ✅ Native |
@Mentions in comments | Build custom | ✅ Native | ✅ Native |
Multi-author attribution | Build custom | ✅ Native | ✅ Native |
Real-time collab integration | Complex Y.js work | ✅ Native | ✅ Native (Q3 2026) |
Notification webhooks | Build custom | ✅ Adapter API | ✅ Native |
Multi-model AI included | Build custom | 💰 $99+/mo extra | ✅ Included |
Frameworks supported | React only | React, Vue, Angular | 7 frameworks |
Bundle size | ~90-165 KB | ~500 KB | ~140 KB |
Base pricing | Free (MIT) | $144-$864/mo Cloud | $12-$59/mo |
AI pricing | Build/API costs | +$99/mo | Included on Premium |
3-year total (AI + collab) | $37,000-$74,000 | $10,000-$34,000 | $2,124 |
3-Year Cost Math: Real Numbers
For a typical React SaaS with 1,000 users needing comments + AI + collaboration:
Custom Build (Lexical or TipTap)
- Senior engineering (3 weeks initial build): $18,000
- Backend for threads/replies: $4,000
- Notification service integration: $3,000
- Y.js integration for multi-user comments: $8,000
- Ongoing maintenance (5 hrs/mo × $150/hr × 36 mo): $27,000
- 3-year total: $60,000
CKEditor 5 Cloud + Comments + AI Assistant
- Cloud (mid-tier): $432/mo × 36 = $15,552
- AI Assistant: $99/mo × 36 = $3,564
- Setup + initial integration (6 hrs @ $150): $900
- 3-year total: $20,016
Eddyter AI Pro Managed
- Base plan: $59/mo × 36 = $2,124
- Includes: comments (Q4 2026), track changes (Q4 2026), real-time collab (Q3 2026), multi-model AI, all editor features, infrastructure
- 3-year total: $2,124
The Real Savings
- vs Custom build: Eddyter saves $57,876 over 3 years (96.5% cost reduction)
- vs CKEditor 5: Eddyter saves $17,892 over 3 years (89.4% cost reduction)
For teams that can wait for Q4 2026, Eddyter delivers dramatic savings. For teams needing comments this quarter, CKEditor 5 is the strongest immediate option.
5-Question Decision Framework
Use this to pick the right path for your team:
1. When do you need comments in production?
This quarter (Q3 2026) → CKEditor 5. Only production-ready option today.
Late 2026 or 2027 → Eddyter native. Flat pricing + AI included.
Timeline flexible → Consider custom build for total control.
2. What frameworks does your product use?
React only → Any option works.
Multi-framework → Eddyter (Q4 2026). Custom builds and CKEditor 5 have limited multi-framework support.
3. Do you need @mentions inside comments?
Yes → All 4 paths support it. CKEditor 5 + Eddyter Q4 2026 native. Custom builds require extra 3-5 days for the mention autocomplete.
4. Do you need multi-model AI alongside comments?
Yes → Eddyter. GPT-5, Claude Sonnet 5, Haiku 4.5, Gemini 3 built in.
Single AI provider OK → CKEditor 5 AI Assistant.
No AI → Any option works.
5. What's your budget model?
Flat pricing preferred → Eddyter ($59/mo flat). Best for scale.
Per-Cloud-tier pricing OK → CKEditor 5 ($144-$864/mo Cloud).
One-time engineering cost + infra → Custom build.
7 Common Comment Pitfalls
Pitfall 1: Losing Anchor When Text Is Edited
Comment anchored to characters 100-120. User inserts 10 characters at position 50. Naive implementations leave the anchor at 100-120, but the anchored text is now at 110-130. Comment appears on wrong text.
Fix: Store anchor as marks/nodes tied to specific text, not character positions. When text moves, the mark moves with it.
Pitfall 2: Not Handling Deleted Anchored Text
User deletes text that a comment was anchored to. Comment becomes orphaned but disappears from UI.
Fix: Show orphaned comments in sidebar with "text was deleted" indicator. Preserve the comment for context.
Pitfall 3: Flat Reply Structure (No Threading)
Naive implementations show all replies as siblings. Complex discussions become impossible to follow.
Fix: Support nested replies (max 2-3 levels deep). Threading beats flat lists.
Pitfall 4: No Bidirectional Highlighting
Clicking a comment anchor in editor doesn't scroll to thread. Clicking a thread doesn't highlight anchor. Users can't navigate.
Fix: Emit events on anchor click. Sidebar listens and scrolls thread into view. Sidebar click emits event that highlights anchor.
Pitfall 5: No Notification Deduplication
User replies twice to same thread within 5 minutes. Two notifications sent. Every mention resolves as separate notification.
Fix: Debounce notifications per user per thread (5-15 minute window). Batch mention notifications when possible.
Pitfall 6: Rich Text Not Supported In Comment Body
Users can only type plain text in comments. Can't format, can't paste links properly, can't attach.
Fix: Use a lightweight editor inside comments (nested editor). Supports basic formatting, mentions, and links.
Pitfall 7: No Filter or Search Options
Sidebar shows all comments in creation order. Products with 100+ comments become unusable.
Fix: Filter by status (open/resolved), by author, by @mention. Add search across comment text. Sort by newest/oldest.
When You Don't Need Comments
Three scenarios where comments add complexity without value:
1. Single-Author Content
Personal notes, personal blogs, individual document editing. Comments require multi-user coordination that doesn't apply.
2. Fast Publishing Workflows
Marketing pages, product descriptions, help articles where edits happen quickly. Comment overhead slows down fast content updates.
3. Real-Time Only Editing
Google Docs-style live editing without approval workflows. Users see each other's cursors directly — comments become chat replacement.
Frequently Asked Questions
1. What's the best React editor for comments in 2026?
For most teams needing comments today in 2026, CKEditor 5 is the strongest production-ready option — full threaded discussions, resolve/reopen, multi-author attribution, and @mentions inside comments at $144-$864/mo Cloud + $99+/mo AI Assistant. For teams that can wait for Q4 2026, Eddyter native comments delivers the same features plus multi-model AI (GPT-5, Claude Sonnet 5, Haiku 4.5, Gemini 3) at $12-$59/mo flat pricing with 10-minute setup. For teams with 2-4 weeks of senior engineering time and specific requirements, custom builds in Lexical or TipTap give total control at $37K-$74K over 3 years.
2. How long does it take to build comments from scratch?
Building production-quality comments for a React editor takes 2-4 weeks of senior engineering time in 2026. This covers: comment data model design (2-3 days), custom comment anchor nodes for the editor (3-5 days), text selection detection and creation UI (2-3 days), threaded sidebar component (5-7 days), backend for threads/replies (3-5 days), notification service integration (2-3 days), Y.js collaboration integration (5-7 days), anchor persistence across edits (2-3 days), and QA (3-5 days). Total 3-year cost including engineering and infrastructure: $37,000-$74,000+. Eddyter delivers equivalent comments in 10 minutes at $2,124 over 3 years when it launches Q4 2026.
3. Can I add comments to an existing Lexical or TipTap editor?
Yes, but the integration pattern differs. Lexical requires defining custom CommentAnchorNode with DecoratorNode subclass, building a plugin for text selection detection, and creating threaded sidebar UI (~2-4 weeks). TipTap requires custom Mark extension with attributes, selection interception, and sidebar UI (~2-4 weeks). CKEditor 5 ships with a native Comments plugin available today (4-6 hours setup with commercial license). Eddyter is built on Lexical with comments launching Q4 2026 as a native feature — 10-minute setup with no custom code required.
4. Does CKEditor 5 support comments today?
Yes, CKEditor 5's Comments plugin is available today (2026) as part of paid Cloud plans starting at $144/mo. It supports threaded discussions with replies, resolve/reopen workflow, multi-author attribution with distinct avatars, @mentions inside comments, real-time collaboration integration, backend adapter API for connecting to your own comment storage, and revision history. Combined with the AI Assistant plugin ($99+/mo), CKEditor 5 delivers the most complete production comments experience in 2026. Trade-offs are heavy 500 KB bundle size, complex commercial licensing, and combined pricing that can reach $1,000-$1,500/mo for full AI + collab + comments.
5. When will Eddyter support comments?
Eddyter's native comments launches Q4 2026. When available, it will support threaded discussions with replies, resolve/reopen workflow, multi-author attribution with distinct colors, @mentions inside comments with autocomplete, integration with Q3 2026 Eddyter real-time collaboration, notification webhooks for reply and mention events, multi-model AI (GPT-5, Claude Sonnet 5, Haiku 4.5, Gemini 3) alongside comments in one integration, and 7-framework support (React, Next.js, Vue 3, Angular 17-20, Svelte 4/5, Laravel, Vanilla JS). Pricing will be included in AI Pro Managed ($59/mo flat).
6. How do I handle comments with real-time collaboration?
Comments + real-time collaboration require synchronization across users. When 3 users add comments and replies simultaneously with tracking enabled, thread state must merge deterministically — each user's actions attributed correctly. Standard solution uses Y.js awareness to synchronize comment threads across clients, CRDT logic to resolve conflicts (two people replying at once), and per-author queues that maintain attribution during merging. Custom implementations take 5-7 days extra. CKEditor 5 handles this natively as part of its Collaboration Server. Eddyter Q4 2026 launches with native support based on Y.js foundation. For Y.js implementation patterns, see How to Add Real-Time Collaboration to a React Editor With Y.js 2026.
7. How do I send notifications when someone comments or replies?
Notifications fire in three scenarios: (1) User mentioned in a comment or reply, (2) Someone replies to your thread, (3) Your comment is resolved or reopened. Custom pattern: on each event, dispatch a notification job to your notification service (email, Slack, in-app, or push). Extract mentioned user IDs from [@mention] markup in comment content. Dedupe notifications per user per document per hour to avoid spam. Eddyter Q4 2026 will support notification webhooks configured per event type. CKEditor 5's backend adapter API lets you hook into every comment lifecycle event. For notification patterns, see How to Add @Mentions to a React Rich Text Editor 2026.
8. What's the alternative to building custom comments?
The strongest managed alternatives in 2026 are CKEditor 5 Comments (production-ready today, $144-$864/mo Cloud + $99+/mo AI Assistant, comprehensive feature set, enterprise compliance) and Eddyter native comments (Q4 2026 launch, $12-$59/mo flat, multi-model AI included, 7-framework support, 10-minute setup). For teams shipping comments this quarter, CKEditor 5 is the fastest path. For teams building for late 2026 or 2027 launch, Eddyter combines comments with track changes, real-time collab, and AI at flat pricing. TipTap Pro offers @tiptap-pro/extension-comment as part of paid Cloud plans starting at $49-$999/mo. Skip building custom unless comment UX is your core product differentiator.
Ready to Ship Comments?
Stop engineering thread anchoring, sidebar UI, resolve/reopen state, notification wiring, and Y.js collaboration integration from scratch. Deploy CKEditor 5 today for immediate comments, or plan for Eddyter's Q4 2026 native launch — comments + track changes + multi-model AI + real-time collab in one editor at $12-$59/mo flat pricing, 10-minute setup, 7-framework support.
👉 Try Eddyter free at eddyter.com
📚 Read the docs
💰 See pricing
🎥 Watch the intro video | Watch the 30-min integration guide

Written by
Shreya Taneja
Project Manager

