Rich Text Editor
A versatile text editing component with 6 variants for different use cases, from simple comments to full document editing with AI assistance.
Minimal
Lightweight editor for quick comments, feedback, and short notes
Basic
Essential formatting options for everyday content creation
Standard
Full formatting with headings, alignment, and text styling options
Advanced
Complete editing suite with tables, images, code blocks, and fullscreen mode
AI-Enhanced
Integrated AI writing assistant for improving, expanding, and translating content
Markdown
Split-view Markdown editor with live preview for technical documentation
Welcome to Markdown Editor
This editor supports bold, italic, and strikethrough text.
Features
const greeting = "Hello, World!";
console.log(greeting);
This is a blockquote for important notes.
Learn more at Eidetic Design System.
Variant Comparison
Choose the right editor for your use case
| Variant | Use Case | Key Features |
|---|---|---|
| Minimal | Comments, quick notes | Bold, italic, emoji, mentions |
| Basic | General text editing | Lists, links, basic formatting |
| Standard | Blog posts, articles | Headings, alignment, blockquotes, code |
| Advanced | Documents, reports | Tables, images, colors, fullscreen |
| AI-Enhanced | Content creation | AI writing assistance, tone adjustment |
| Markdown | Technical docs | Split view, live preview, syntax support |
Props
Common props for all editor variants
| Prop | Type | Default | Description |
|---|---|---|---|
placeholder | string | — | Placeholder text shown when empty |
maxLength | number | — | Maximum character count |
variant | 'default' | 'error' | 'default' | Visual variant for validation |
className | string | — | Additional CSS classes |
onChange | (html: string, text: string) => void | — | Change handler |
AIEnhancedEditor Additional Props
| Prop | Type | Default | Description |
|---|---|---|---|
onAIAction | (action: string, content: string) => void | — | AI action callback |
MarkdownEditor Additional Props
| Prop | Type | Default | Description |
|---|---|---|---|
defaultValue | string | — | Initial markdown content |
onChange | (markdown: string) => void | — | Markdown change handler |
Usage
Import and implementation example
import {
MinimalEditor,
BasicEditor,
StandardEditor,
AdvancedEditor,
AIEnhancedEditor,
MarkdownEditor,
} from '@/blocks/forms/rich-text-editor'
export default function Example() {
return (
<>
{/* Minimal - for comments */}
<MinimalEditor
placeholder="Add a comment..."
maxLength={500}
onChange={(html, text) => console.log(text)}
/>
{/* Basic - general editing */}
<BasicEditor
placeholder="Start typing..."
maxLength={2000}
/>
{/* Standard - blog posts */}
<StandardEditor
placeholder="Write your article..."
maxLength={5000}
onChange={(html, text) => console.log(html)}
/>
{/* Advanced - full editing */}
<AdvancedEditor
placeholder="Write your content..."
maxLength={20000}
/>
{/* AI-Enhanced - with AI assistance */}
<AIEnhancedEditor
placeholder="Write something amazing..."
maxLength={10000}
onAIAction={(action, content) => {
console.log('Action:', action)
console.log('Content:', content)
}}
/>
{/* Markdown - for developers */}
<MarkdownEditor
placeholder="Write in Markdown..."
maxLength={15000}
defaultValue="# Hello World"
onChange={(markdown) => console.log(markdown)}
/>
</>
)
}Features
Built-in functionality
- Six variants: From minimal to full-featured editing
- WYSIWYG editing: Content editable with visual formatting
- Character counting: Track character and word counts
- Keyboard shortcuts: Ctrl+B, Ctrl+I, Ctrl+U and more
- AI assistance: Improve, expand, and translate content
- Markdown preview: Split view with live rendering
- Table support: Insert and edit tables (Advanced)
- Dark mode: Full dark mode support
Accessibility
Accessibility considerations
ARIA Attributes
Content editable has proper roleToolbar buttons have title attributesFocus states meet WCAG 2.4.7Keyboard Navigation
| Key | Action |
|---|---|
| Ctrl+B | Toggle bold |
| Ctrl+I | Toggle italic |
| Ctrl+U | Toggle underline |
| Tab | Navigate toolbar buttons |
Notes
- Clear focus ring with 2px width
- Color contrast 4.5:1 for text
- Visual feedback for character limit
- Toolbar buttons are keyboard accessible