Release notes
Every block is sanitised before render — even this <script>alert(1)</script> tag comes out as inert text.
- Faster cold start
- New pivot table component
- Dark-mode contrast fixes
Ship small, ship often.
const version = '3.29.0';Every block is sanitised before render — even this <script>alert(1)</script> tag comes out as inert text.
Ship small, ship often.
const version = '3.29.0';import { TkxRichTextDisplay } from 'tekivex-ui';
const blocks = [ { type: 'heading', level: 2, content: 'Welcome' }, { type: 'paragraph', content: 'This is the first paragraph.' }, { type: 'list', ordered: false, items: ['One', 'Two', 'Three'] }, { type: 'blockquote', content: 'A pithy quotation.' }, { type: 'code', language: 'tsx', content: 'const hello = "world";' },];
<TkxRichTextDisplay blocks={blocks} />Block schemas are easier to validate, sanitise, and version than HTML.
Every block has a known type, and only known types render. Unknown
types are silently dropped — there’s no escape hatch for embedding raw
HTML, which means no XSS surface.
Use this for content that comes from a CMS, database, or LLM output where you want strict control over what can render.
| Type | Fields |
|---|---|
paragraph | text |
heading | level (1–6), text |
list | ordered, items[] |
quote | text, cite? |
code | language?, text |
image | src, alt, caption? |
divider | (no fields) |
embed | provider (‘youtube’ | ‘vimeo’ | ‘codepen’), id |
text fieldsparagraph / heading / quote text fields support a tiny inline
syntax:
**bold** → <strong>*italic* → <em>`code` → <code>[label](url) → <a> (URL passes through sanitizeHref())That’s it. No HTML, no Markdown extensions, no image inlining.
{ type: 'embed', provider: 'youtube', id: 'dQw4w9WgXcQ' }Renders an <iframe> only for the listed providers, with a strict CSP
sandbox attribute. Other providers render as a fallback link.
<article> with localised aria-label (e.g. “Rich text content”
→ “حتوى نص منسق” in Arabic)image blocks require non-empty alt (errors at runtime if missing)code blocks render as <pre><code> with no syntax highlighting fallback
(fully readable to screen readers)| Prop | Type | Required | Description |
|---|---|---|---|
blocks | RichTextBlock[] | yes | Array of block objects. |
className | string | ||
style | CSSProperties |