Skip to main content

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-rtl

Usage

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

NameTypeDefaultDescription
content
Required
stringundefinedThe 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
booleantrueEnable syntax highlighting for code blocks
enableGFM
booleantrueEnable GitHub Flavored Markdown features
className
stringundefinedAdditional CSS classes to apply