@oge-ui/react-editor
v1.1.3
Published
React rich-text editor from the OGE UI suite: a dependency-free contenteditable editor over its own document model (no execCommand) with headings, lists, quotes, code, links, images, colours and alignment, its own undo history, markdown shortcuts, Word /
Maintainers
Readme
@oge-ui/react-editor
Rich-text editor for React 18 and 19 — a contenteditable editing surface
driven by a document model of its own, with a sanitized HTML value. It runs
the same @oge-ui/behavior editor machine and the same stylesheet as the
Angular @oge-ui/editor. Dependency-free, MIT.
npm install @oge-ui/react-editorimport { OgeEditor } from '@oge-ui/react-editor';
import '@oge-ui/react-layout/styles.css';
import '@oge-ui/react-overlay/styles.css';
import '@oge-ui/react-inputs/styles.css';
import '@oge-ui/react-editor/styles.css';
<OgeEditor label="Description" value={html} onValueChange={setHtml} />;What it does
- Formatting — bold, italic, underline, strikethrough, inline code, sub/superscript, text and highlight colours, headings, quotes, code blocks, nested bulleted and numbered lists, links, images by URL, horizontal rules, alignment and per-block text direction.
- No
execCommand— every edit is a command on the editor's own document model; undo/redo is the editor's own history. - Keyboard first — Ctrl/⌘+B / I / U / K / Z / Y, Shift+Enter, Tab /
Shift+Tab in lists, and markdown shortcuts (
#,-,1.,>). - Safe HTML in and out — a strict allowlist sanitizer for values, pastes
(Word and Google Docs are cleaned up) and
insertHtml(); links throughsanitizeUrl, images throughsanitizeResourceUrl; Trusted Types policyoge-ui#editor; the live DOM is built withcreateElement, neverdangerouslySetInnerHTML. - Controlled or uncontrolled, a
refhandle (exec,insertHtml,undo, …),useId()-based ids and a'use client'build.
Docs
- Live demos and the full API reference: https://www.ogeui.com/components/editor?framework=react
- Machine-readable reference for coding assistants:
node_modules/@oge-ui/react-editor/llms.txt
License
MIT. See LICENSE.
