Skip to main content
Version: latest
Works everywhere

Rte works in both server and client environments. Always use the standard import (e.g. @prokodo/ui/rte) — the library detects the runtime automatically.

RTE

RTE (Rich Text Editor) provides a WYSIWYG editing experience with a configurable toolbar. Supports markdown shortcuts, inline formatting, lists, links, and optional image upload.

Beta

RTE is currently in beta. API details and behavior may still change in upcoming releases.

Live demo →

Overview

import { RTE } from "@prokodo/ui/rte"
;<RTE
name="content"
value={editorValue}
onChange={setEditorValue}
label="Article content"
/>

Import

import { RTE } from "@prokodo/ui/rte"

CSS:

import "@prokodo/ui/rte.css"

Props

PropTypeDefaultRequiredDescription
idstringHTML id for the editor.
labelstringLabel text shown above the editor.
valuestringControlled HTML content value.
defaultValuestringUncontrolled initial HTML value.
placeholderstringPlaceholder text.
disabledbooleanfalseDisable the editor.
requiredbooleanfalseMark field as required.
errorTextstringError message shown below the editor.
helperTextstringHelper text shown below the editor.
rteOptionsRTEOptionsQuill editor options config.
rteToolbarRTEFeature[]Toolbar feature array override.
onChange(html: string, meta: { text: string }) => voidCalled on content change with HTML and plain text.
classNamestringCSS class on root element.

See src/components/rte/RTE.model.ts for the full RTEProps type.


Design Tokens

Customise RTE via CSS custom properties on :root or a scoped ancestor.

TokenDefaultDescription
--pk-rte-bgvar(--pk-color-surface)Editor background
--pk-rte-toolbar-bgcolor-mix(in srgb, var(--pk-color-brand) 8%, var(--pk-color-surface))Toolbar background tint
--pk-rte-accentvar(--pk-color-brand)Active toolbar item colour
--pk-rte-icon-colorvar(--pk-color-fg)Toolbar icon colour
--pk-rte-picker-bgvar(--pk-color-surface)Colour-picker background
--pk-rte-picker-shadow0 10px 30px rgba(0,0,0,0.12)Picker shadow
--pk-rte-code-bgcolor-mix(in srgb, var(--pk-color-fg) 6%, transparent)Inline code background
--pk-rte-radiusvar(--pk-radius-md)Editor border radius

AIC Note

Use the standard import path in application code:

import { RTE } from "@prokodo/ui/rte"

No separate /client or /lazy import selection is required in consumer code.

AIC components also support a priority flag for critical above-the-fold elements. This is most visible on Image (native preloading via <link rel="preload"> for above-the-fold content).


WCAG 2.2 Status

CriterionNameStatusNote
1.3.1Info and Relationships (A)✅ FulfilledSemantic structure (headings, lists, labels, landmarks) must be conveyed programmatically via HTML or ARIA.
1.3.5Identify Input Purpose (AA)🔍 Manual reviewForm fields collecting personal data must expose their purpose via the HTML autocomplete attribute.
2.1.1Keyboard (A)🔍 Manual reviewAll functionality must be operable via keyboard alone, without requiring specific timing.
2.1.2No Keyboard Trap (A)🔍 Manual reviewKeyboard focus must never become trapped inside a component; users must always be able to navigate away using standard keys.
2.4.3Focus Order (A)🔍 Manual reviewThe keyboard focus sequence must preserve meaning and operability in the complete page integration context.
2.4.7Focus Visible (AA)🔍 Manual reviewA visible keyboard focus indicator must be present on every interactive element. Verify against the applied product theme.
2.4.11Focus Not Obscured (Min.) (AA)🔍 Manual reviewThe focused component must not be fully hidden by sticky headers, overlays, or other positioned page elements.
3.3.1Error Identification (A)🔍 Manual reviewInput errors must be identified and described to the user in text, not by colour alone.
3.3.2Labels or Instructions (A)✅ FulfilledEvery form input requires a programmatically associated label or a visible instruction.
4.1.2Name, Role, Value (A)✅ FulfilledName, role, and state of all interactive UI components must be programmatically determinable via native HTML semantics or ARIA.
4.1.3Status Messages (AA)✅ FulfilledStatus messages (loading, success, error, progress) must reach assistive technologies without a focus change (aria-live or role='status').

Test coverage: 2 jest-axe assertion(s) across 6 test file(s) · 5 ARIA attribute occurrence(s) in source scan. Criteria marked 🔍 require manual verification in the final product integration and theme context.

Storybook

👉 Open RTE in Storybook


Source

src/components/rte/RTE.model.ts