ContentRenderer
v0.4.0
Markdown/HTML content renderer with automatic RTL/LTR detection and proper code block handling.
Live Demo
Rendered Content
Content with automatic direction detection
Sample Content
This is bold and italic text.
- List item 1
- List item 2
const example = "code block";Installation
npm install noorui-rtlUsage
import { ContentRenderer } from 'noorui-rtl'
// Render HTML content
<ContentRenderer
content={htmlContent}
format="html"
dir="auto"
/>
// Render plain text
<ContentRenderer
content={textContent}
format="text"
dir="rtl"
/>Props
| Name | Type | Default | Description |
|---|---|---|---|
contentRequired | string | undefined | The content to render |
format | 'markdown' | 'html' | 'text' | 'markdown' | Content format (markdown, html, or text) |
dir | 'auto' | 'ltr' | 'rtl' | 'auto' | Text direction (auto, ltr, or rtl). Use auto for automatic detection. |
enableCodeHighlight | boolean | true | Enable syntax highlighting for code blocks |
enableGFM | boolean | true | Enable GitHub Flavored Markdown features |
className | string | undefined | Additional CSS classes to apply |