Overview
HTML to save (250 characters)
<h2>Meeting notes</h2><p>Select text to format it, type <strong>/</strong> for the Slash menu, or paste Markdown. See the <a href="/editor">Editor guides</a>.</p><ul><li><p>Ship the new search</p></li><li><p>Keep the old one until March</p></li></ul>
When to use
- Long formatted text: an article, a description, a policy, a proposal to a client. The author writes headings, lists, quotes and highlights words.
- The value is stored and served as HTML and is shown later by a page.
- A component "for the future" (ADR-0048): at release there was no requesting screen, so the API is modeled on comparable products — Imperavi Redactor 5, Tiptap Simple Editor, minimal-tiptap, Notion. Your screen is the first test of this API. The engine decision is in ADR-0050.
- The Details Block
detailsis "for the future" too (ADR-0048): at release there was no requesting screen, and the API follows the Details extension from Tiptap; the first screen is entitled to ask for a different API. - Formulas
mathematicsare "for the future" too (ADR-0048): at release there was no requesting screen, and the API follows the Mathematics extension from Tiptap; the first screen is entitled to ask for a different API. - Typography
typographyis "for the future" too (ADR-0048): at release there was no requesting screen, and the API follows the Typography extension from Tiptap; the first screen is entitled to ask for a different API. - The invisible characters Tool
invisibleCharactersis "for the future" too (ADR-0048): at release there was no requesting screen, and the API follows the Invisible Characters extension from Tiptap; the first screen is entitled to ask for a different API.
When not to use
- Plain multiline text without markup —
TextControl as="textarea". The Editor with its engine weighs 295–339 kB gzipped (size table); a two-line comment is not worth it. - Code or configuration is not rich text. To show code, use
CodeView; the kit has no code editor (ADR-0039). - Showing a saved Document without editing.
readOnlykeeps the engine alive; for a page that only displays the Document, useRichTextView— it has no engine and works in a server component.
Installation
The engine is not in the kit's manifest — neither in peerDependencies nor in dependencies: if you do not import the @olddevs/ui/editor entry point, you install nothing, and a kit update does not drag Tiptap in. The engine used to be optional peer dependencies, but the kit's previous registry dropped the optional flag, and npm installed the engine for every consumer. The trade-off: npm does not warn about a version mismatch, so keep the range below yourself. If you do import it, install everything with one command:
npm install @tiptap/core @tiptap/pm @tiptap/react @tiptap/starter-kit @tiptap/extensions \
@tiptap/extension-list @tiptap/extension-subscript @tiptap/extension-superscript \
@tiptap/extension-text-style @tiptap/extension-highlight @tiptap/extension-text-align @tiptap/extension-link \
@tiptap/extension-table @tiptap/extension-details @tiptap/extension-blockquote @tiptap/extension-horizontal-rule \
@tiptap/extension-invisible-characters @tiptap/extension-typography \
@tiptap/extension-mathematics katex@0.18.10 \
@tiptap/markdown marked @tiptap/suggestion \
@tiptap/extension-code-block-lowlight lowlight highlight.jsInstall all the packages even if your set of Tools has no task list or no superscript and subscript: the entry point imports the extensions statically, and the tools choice happens only when the field is created. The code block and the table arrive in a separate chunk (see the "Skeleton" section), but the bundler still resolves their packages at build time — @tiptap/extension-table, @tiptap/extension-code-block-lowlight, lowlight and highlight.js are needed by a screen with basic too. npm and yarn install @tiptap/extension-blockquote and @tiptap/extension-horizontal-rule together with @tiptap/starter-kit, but in pnpm's strict node_modules you must name them explicitly — the command above already includes them. The floating Toolbar takes its positioning from @tiptap/react/menus: the @tiptap/extension-bubble-menu it needs (with @floating-ui/dom) is an optional dependency of @tiptap/react itself, and the package manager installs it along with it. If you install packages with --omit=optional, add it explicitly.
The command already contains @tiptap/extension-mathematics and katex for the mathematics Tool (the "Formulas" section; the decision is ADR-0070). katex is pinned to an exact version: the range ^0.18 would pull in the withdrawn 0.18.11, while the Tiptap 3.32 extension accepts only ^0.18; the version is raised once the extension accepts 0.19. The KaTeX code and its CSS with fonts load lazily and only for an Editor with formulas; the weight of pages without formulas does not change. The consumer has no extra step — no style import, no font copying: the bundler takes them from the katex package.
The Editor has three entry points. @olddevs/ui/editor is the Editor itself, the View and sanitization; it needs the engine packages above. @olddevs/ui/editor/schema is the Schema as data only (RICH_TEXT_SCHEMA, richTextSchema(tools)), the sanitizeRichText(html, DOMPurify) sanitizer, the closed config richTextSanitizeConfig() for the server, and the Text card helper markRange. The graph of this entry point has neither React nor Tiptap, so there is nothing to install (the consumer brings DOMPurify). @olddevs/ui/editor/highlight is highlighting without the Editor: highlightCodeBlocks(html) for a saved Document (see the "Code block" section below) and highlightCodeNodes(code, language) — the same tokens as nodes, for CodeView; that entry point's graph contains lowlight, highlight.js and react. Sanitization with DOMPurify is on the RichTextView page.
In Next.js, add the @olddevs/ui/editor entry point to optimizePackageImports as a separate line next to @olddevs/ui (getting-started.md): without it, a page that imports just RichTextView from the entry point ships the whole Editor with the engine to the browser.
Keep the Tiptap package versions identical: they reference each other by exact version. The range is ^3.32.0.
A separate Tailwind @source is not needed: the Editor's classes sit in the same dist as the rest of the kit, and the @source "./node_modules/@olddevs/ui/dist" line from getting-started.md already covers them.
Minimal example
import { FormField } from "@olddevs/ui";
import { RichTextEditor } from "@olddevs/ui/editor";
<FormField label="Description" htmlFor="description" hint="Shown on the overview page">
<RichTextEditor id="description" value={html} onChange={setHtml} maxLength={5000} />
</FormField>;Public API
value+onChange(html)ordefaultValue— as in the other fields (conventions.md, "State management"). An empty Document is"", not<p></p>.defaultValuealso accepts a JSON envelope (RichTextDocument, see the "JSON" section);valueandonChangeare always HTML.onChangeis called no more often than once perchangeDelayms (300 by default), on the trailing edge, and immediately — onblur, before the form'ssubmitand when buildingnew FormData(form). Serializing the Document to HTML is a walk over the whole tree, and on every keystroke it would slow typing in long Documents.changeDelay={0}emits every edit.- An incoming
valueequal to the last emitted HTML does not recreate the Document and does not move the cursor: the ordinary round trip, where the field emits a value and gets it back, is safe. A differentvaluereplaces the whole Document; such a replacement is not an edit, andonChangeis not called for it. namerenders an<input type="hidden">with the current HTML — the value is included inFormDataand in native form submission.sourceFormatselects"html"(default) or"markdown"for the Source field at mount time.maxLengthis the character limit: the Document's text without markup and without Block separators; an Atom counts as the length of its Atom text (a horizontal rule 0, a hard break 1, an image the caption length; see "Custom Tool"). The remaining-count indicator appears at 80 % of the limit and is part of the field's description; input beyond the limit is rejected, a paste is trimmed to what fits: the tail is cut by characters, and an Atom that did not have room is dropped entirely along with everything after it. Avaluelonger than the limit loads in full: this is the screen's data, it may be shortened but not lengthened, and the counter shows by how much the limit is exceeded.readOnly— the engine keeps running, the text can be selected and is submitted with the form, editing is disabled.disabled— as in other fields: editing is disabled, the field is muted, and it is not submitted with the form.<fieldset disabled>disables the Editor, like a native field — bothForm pendingand the consumer'sfieldset. Switching on the fly is picked up (aMutationObserveron thedisabledattribute of ancestorfieldsetelements), without remounting. The DOM is read, not theFormcontext: that covers both cases with one rule.placeholderdefaults to the string from the message catalog (editor.placeholder).allowRelativeLinksdefaults tofalse. Set it totrueto keep relative paths and fragments when loading or editing HTML, importing Markdown or entering a link in the popover. Changing this setting requires remounting the Editor. See Links.onReady(),onFocus(),onBlur()— field events, no arguments; see "Events".onReadyis once per mount,onFocusandonBlurreport the Field focus (the Document, the Toolbar, popovers, the Source field), and beforeonBlura pendingonChangeis flushed.onUploadImage(file) → Promise<string>— the image uploader, see "Images". Without it files are not accepted.maxHeight— the height limit of the Document area (a number is pixels, a string is a CSS length), beyond it the Document scrolls inside the frame;resizable— a height handle at the area's bottom edge (a slider for keyboard users), andmaxHeightwith it is the starting height. See "Field height".surface—"theme"(default) or"paper": a light Paper in any theme, see "Surface". The type isRichTextSurface.status— a React node of the Status bar inside the field's frame, at the start of the counter row; the kit does not announce it. The engine commandshowNotice({ tone, text } | null)is the Field notice. Both are in "Status bar and Field notice"; they follow the kit's semver.tools— kit names, Configured Toolstool(name, options)forsearch,toc,details,mathematics,youtube,twitch,typography,invisibleCharacters,focus,languageanddate,defineTool(…)definitions and descriptions of custom Tools (CustomTool, including theirbuttons,insertItems,blockActions,textCardsandtrigger), Presets as arrays —RICH_TEXT_PRESETS; see "Tools and Presets" and "Custom Tool". A description with an error is a field error.ref(RichTextEditorHandle):getHTML()— the current HTML, without waiting for the delay and withoutonChange(in Source mode it first applies the field's edit — thenonChangeis called if the Document changed; the same forgetMarkdown());getMarkdown()andsetMarkdown(md)— see "Markdown";getJSON()andsetJSON(document)— see "JSON";clear()— clear the Document, andonChange("")notifies the screen;focus(position?),blur(),insertHTML,insertText,getText,getSelectedText,isEmpty,undo,redo,canUndo,canRedo— see "Handle (ref) and your own toolbar outside the field";tool(name)— the commands of a Tool, see "Tool commands:handle.tool()";openSearch({ replace? })— deprecated, removed in 5.0, replaced bytool("search")?.open({ replace });editor— the underlying TiptapEditor, its API follows Tiptap's major version, and before mount and on the server it isnull.focus()without an argument puts the caret at the end of the Document (in Source mode, in the Source field).useRichTextEditorState(ref, selector)— a hook for your own toolbar outside the field, see "Handle (ref) and your own toolbar outside the field".useRichTextToolState(ref, name, selector?)— the hook for Tool state (search,toc,invisibleCharacters,fullscreen,focusand custom Tools withdefineTool): a data snapshot,nullbefore mount, after unmount and without the Tool; see "Tool state:useRichTextToolState". It follows the kit's semver, as dotool(),defineTool(),handle.tool()and theRichTextToolsmap.- SSR: the engine is created only in the browser (
immediatelyRender: false). On the server it renders a Skeleton without a Document — the frame and the space reserved for the Toolbar — and a hidden field with the incoming value. After hydration the Skeleton shows the Document cleaned by the Schema, and the editable area takes its place after the Loaders, without a height jump. The exception is a JSON envelope indefaultValue: only the engine builds its HTML, so with it the Skeleton is a frame without a Document, the hidden field is empty until Readiness, and the height changes once when the Document appears.
Anti-patterns
- Storing and showing the Editor's HTML without server-side sanitization.
- Showing a Document with footnotes in two
RichTextViewon one page (the same comment in a feed and in a preview): both carry the samefn-…andfnref-…ids, and a jump in the second goes to the first. An Editor next to its View does not collide. - Storing the Markdown from
getMarkdown()as the main value: color, highlight and alignment are lost in it. - Loading a JSON file with
ref.editor.commands.setContent(json)instead ofsetJSON(): on a Block of a disabled Tool Tiptap silently replaces the whole Document with an empty one, attributes from the JSON pass without Schema rules, and the screen is not notified of the replacement throughonChange. - Storing the JSON envelope in the database instead of the HTML from
onChange: the kit's server sanitization (sanitizeRichText) reads HTML, while the envelope is a file and template format. - Allowing
styleon the server by bypassingsanitizeRichText(for example, by adding it toALLOWED_ATTRof the bare config): the Editor writes it only as the author's color (color:#rrggbbonspan,background-color:#rrggbbonmark), and any other CSS would not have come from it. - Using the author's color where the Document is shown in several themes: unlike the palette, it does not follow the theme.
- Setting
changeDelay={0}"just in case" on long Documents: the form gets fresh HTML before submission anyway. - Writing a link Mark directly through
ref.editorcan bypass the link commands. UsesetLinkortoggleLinkto apply the Editor's URL policy. - Putting an Editor with
toolbar="floating"or"bubble"in a container withoverflow: hiddenright against its top edge: the Toolbar or the Bubble menu above the first line is clipped. - Repainting the Editor's overlays with a solid color through the consumer's
classNameor CSS: the Glass is removed by the system's transparency and contrast setting, and a hand-made background stops respecting that setting. - Overriding the Bubble menu's token colors with your own: the inverse pair is checked for contrast in all themes and brands, and a hand-picked color is not. A brand of your own overrides
--accent-on-inversein its own CSS rule, like--accent-strong. - Calling
ref.editormethods as part of the kit's contract — Tiptap commands follow the engine's major versions; common tasks are covered by the Handle (insertHTML,getText,focus,undo), andeditoris the escape hatch for commands of Marks, Blocks and custom Tools. The exception isshowNotice: it is a kit command and follows semver. - Building the buttons of your own toolbar without
preventDefaultonmousedown: a click takes focus out of the field, and the floating Toolbar together with the Bubble menu disappear. - Reading
ref.current.editor.isActive(...)during render of your own toolbar instead ofuseRichTextEditorState: the toolbar is not notified of a selection change and does not re-render. - Wrapping the whole Status bar in
role="status": the word count would be read aloud on every edit. Announce only what is needed (Saved). - Rendering your own error line under the field, duplicating the Field notice (paste and upload errors):
showNoticealready provides a line withrole="alert", and your own copy would be announced twice. - Wrapping short labels and headings in
RichTextEditor: it is a field for a Document, not for a line. - Hiding a button with a style while leaving the Tool in
tools: the Schema still lets it through — from a paste and by shortcut. Disable the Tool, not the button. - Changing
toolson a mounted field expecting the Schema to be rebuilt: the set is read when the engine is created. - Conveying the meaning of a note by the Callout tone alone: a screen reader cannot see the background, a color-blind person cannot tell the tones apart, and in Markdown without alert support only a quote remains. Write it in words — "Warning: …" (WCAG 1.4.1).
- Coloring text inside a Wrapper that has a tone with a palette color or a custom color: on a colored background its contrast may fall below 4.5:1 — the gate checks the Document's main and secondary text, not the author's color.
- Changing
tool(…)on a mounted field expecting new options: they are read when the engine is created, liketools. To change options, remount the field with a key. - Taking the number of Find matches or the headings of the Table of contents from
ref.current.editor, from the Document's DOM or from internal plugin keys: that is not the kit's contract and it follows the Tiptap major. UseuseRichTextToolStatefor this. - Calling
openSearch()in new code: the method is deprecated and will disappear in 5.0. Usetool("search")?.open(). - Writing
tool("bold", …)or options the Tool does not have intools: the compiler stops it, and in JS without types the extra option is dropped with aconsole.error. - Keeping the
blockSelectionTool (it is infull) in a comment field inside aDialogor aDrawerand expecting oneEscapeto close the window: the firstEscapein the text selects the Block, and the window closes on the second. Usepreset="basic"or an exacttoolslist without it for such a field. - Reading the selected Blocks from
ref.current.editor.state.selectionor from the.rte-block-selectedclass: that is not the kit's contract. UseuseRichTextToolState(ref, "blockSelection")for the count andhandle.tool("blockSelection")for the commands.
Links
- Source:
src/editor/RichTextEditor.tsx; the Toolbar issrc/editor/ui/EditorToolbar.tsx, the formatting menus ("¶", "…", "Alignment", "Lists") aresrc/editor/ui/FormatMenus.tsxandsrc/editor/core/blockTypes.ts, the floating one issrc/editor/ui/FloatingToolbar.tsx, the Bubble menu issrc/editor/ui/SelectionBubble.tsx, the shared display condition and position aresrc/editor/ui/selectionMenu.ts; the link issrc/editor/features/link/link.ts, the Tool descriptionsrc/editor/features/link/linkTool.tsxand the URL formsrc/editor/features/link/LinkPopover.tsx; emoji are the Tool descriptionsrc/editor/features/emoji/emojiTool.tsxand the gridsrc/editor/features/emoji/EmojiGrid.tsx; buttons from Tool descriptions and the frame of their popovers aresrc/editor/ui/ToolButtonView.tsx, their shortcuts aresrc/editor/core/toolButtons.ts, the shortcuts of their Insert items and Block actions aresrc/editor/core/toolEntryShortcuts.ts; the image issrc/editor/features/image/image.ts(node, upload, file paste),src/editor/features/image/ImagePopover.tsx,src/editor/features/image/ImageToolbar.tsx; the Field notice is the commandsrc/editor/core/fieldNotice.ts, the file textssrc/editor/features/image/imageNotice.ts, the live region, the error line and the Status barsrc/editor/ui/FieldStatus.tsx; a custom Tool is the public formsrc/editor/core/customTool.ts, the engine and set validationsrc/editor/core/customToolEngine.ts, thetoolsexpansion and the options of built-in Toolssrc/editor/features/builtins.ts;tool()and theRichTextToolsmapsrc/editor/core/toolOptions.ts, the command typessrc/editor/core/toolCommands.ts, the state typessrc/editor/core/toolState.ts, the state hooksrc/editor/hooks/useRichTextToolState.ts, the Find and Table of contents descriptionssrc/editor/features/search/searchTool.tsandsrc/editor/features/toc/tocTool.ts; the table issrc/editor/features/table/tables.ts(nodes, merging, alignment, Markdown),src/editor/features/table/tableActions.ts(menu commands, sorting, size memory),src/editor/features/table/TableMenuButton.tsx(the "Table" menu),src/editor/features/table/TableSizeGrid.tsxandsrc/editor/features/table/TableInsertDialog.tsx; the Column layout issrc/editor/features/layout/layout.ts(nodes, commands, keyboard) andsrc/editor/features/layout/columnLayouts.ts(variants as data); the Wrapper issrc/editor/features/wrapper/wrapper.ts(node, insertion, unwrapping, tone, keyboard, Markdown) andsrc/editor/features/wrapper/wrapperTones.ts(tones and GitHub alerts labels as data); the Details Block issrc/editor/features/details/details.ts(nodes, insertion, unwrapping, keyboard),detailsMarkdown.ts(Markdown as raw HTML) anddetailsTool.ts(the Tool description); the Document with Block containers issrc/editor/core/document.ts; the Handle issrc/editor/core/handle.ts, the hook issrc/editor/hooks/useRichTextEditorState.ts; Source mode is the state and applying insrc/editor/RichTextEditor.tsx, HTML formatting insrc/editor/core/sourceFormat.ts; Tools and Presets aresrc/editor/core/tools.ts; Block commands aresrc/editor/core/blockCommands.ts; the Block handle issrc/editor/ui/BlockHandle.tsx; the shortcut table and labels aresrc/editor/core/shortcuts.ts, the Keyboard shortcuts popover issrc/editor/ui/ShortcutsButton.tsx; the Glass of overlays issrc/editor/styles/glass.ts; the Slash menu issrc/editor/core/insertItems.ts(the item registry),src/editor/ui/SlashMenu.tsx,src/editor/ui/InsertMenuButton.tsx,src/editor/core/slashCommand.ts; the Schema as data issrc/editor/core/schema.ts; the palette and alignments aresrc/editor/styles/palette.ts, the color extensions aresrc/editor/features/color/styleExtensions.ts; the author's color is the form and parsingsrc/editor/features/color/customColor.ts, contrastsrc/editor/features/color/contrast.ts, the popoversrc/editor/features/color/CustomColorPopover.tsx; typography issrc/editor/styles/prose.ts; the code block issrc/editor/features/code/codeBlock.ts(extension, aliases,Alt+F10),src/editor/features/code/CodeBlockView.tsx(the header: language and "Copy"),src/editor/features/code/CodeCopyButton.tsx(the button with a tooltip),src/editor/features/code/codeHeader.ts(header classes shared with the View), the Paper (surface="paper") issrc/editor/styles/surface.tsandsrc/editor/styles/tokens.ts,src/editor/features/code/codeLanguages.ts(languages as data),src/editor/features/code/lowlight.ts(grammars),src/editor/styles/codeTheme.ts(the syntax highlighting theme), the server helper issrc/editor/features/code/highlight.ts; find and replace issrc/editor/features/search/searchTool.ts(the Tool),src/editor/features/search/searchPlugin.tsandsrc/editor/features/search/SearchPanel.tsx; JSON issrc/editor/core/jsonDocument.ts; Field height is the resize handlesrc/editor/ui/FieldResizer.tsx; emoji (the set's data) issrc/editor/features/emoji/emoji.ts; the character limit issrc/editor/core/maxLength.ts; Markdown issrc/editor/core/markdown.ts. - Image alignment source:
src/editor/features/image/imageLayout.ts(the rules that tie the side to the width),src/editor/features/image/ImageAlignGroup.tsx(the three toggles), the keys insrc/editor/features/image/image.tsandsrc/editor/features/color/styleExtensions.ts, the float andclearrules insrc/editor/styles/prose.ts(IMAGE_ALIGN_CLASS) and the paste stepsrc/editor/features/pasteCleanup/imageAlignment.ts. Tests:tests/rich-text-editor-image-align.test.tsx,tests/rich-text-editor-image-align-ui.test.tsx,tests/rich-text-editor-image-align-handles.test.tsx,tests/rich-text-image-align-css.test.tsx,tests/editor-sanitize-image-align.test.tsxandtests/editor-paste-cleanup-image-alignment.test.tsx. Storybook:ImageAlignment,ImageAlignmentNarrow,ImageAlignmentInColumn,ImageAlignmentPasteFromWord,ImageAlignmentRussianandImageAlignmentView. - Block selection source:
src/editor/features/blockSelection/(the Tool, the keys, the moves), the selection itselfsrc/editor/core/blockSelection.ts, the Block unitsrc/editor/core/blockUnit.ts, the group actionssrc/editor/core/blockWrap.tsandsrc/editor/core/blockTurn.ts. - Tests:
tests/rich-text-editor-footnotes.test.tsx,tests/rich-text-editor-footnotes-markdown.test.tsxandtests/rich-text-editor-footnotes-schema.test.tsx(footnotes),tests/rich-text-editor-block-selection.test.tsx(Block selection,EscinDialogandDrawer) andtests/rich-text-editor-block-range.test.tsx(the Block handle over a range),tests/rich-text-editor-text-card.test.tsx(Text card),tests/rich-text-editor.test.tsx,tests/rich-text-editor-handle.test.tsxandtests/rich-text-editor-handle-ssr.test.tsx(Handle and hook),tests/rich-text-editor-toolbar.test.tsx,tests/rich-text-editor-block-menu.test.tsx,tests/rich-text-editor-more-menu.test.tsx,tests/rich-text-editor-align-list-menus.test.tsx,tests/rich-text-editor-insert-menu.test.tsx,tests/rich-text-editor-schema.test.tsx,tests/rich-text-editor-markdown.test.tsx,tests/rich-text-editor-color.test.tsx,tests/rich-text-editor-custom-color.test.tsx,tests/rich-text-editor-link.test.tsx,tests/rich-text-editor-floating.test.tsx,tests/rich-text-editor-bubble.test.tsx,tests/rich-text-editor-glass.test.tsx,tests/rich-text-editor-table.test.tsx,tests/rich-text-editor-lazy-builtins.test.tsx(lazy code block and table:basicdoes not load them,fullshows a Skeleton until the chunks load),tests/rich-text-editor-image.test.tsx,tests/rich-text-editor-notice.test.tsx,tests/rich-text-editor-code-block.test.tsx,tests/rich-text-editor-block-commands.test.tsx,tests/rich-text-editor-block-handle.test.tsx,tests/rich-text-editor-shortcuts.test.tsx,tests/rich-text-editor-layout.test.tsx,tests/rich-text-editor-wrapper.test.tsx,tests/rich-text-editor-wrapper-tone.test.tsx,tests/rich-text-editor-details.test.tsx,tests/rich-text-editor-mathematics.test.tsx,tests/rich-text-editor-mathematics-lazy.test.tsx(formulas: Slash menu, Popover, Markdown, without the Tool; laziness and Skeleton),tests/editor-sanitize-mathematics.test.tsxandtests/rich-text-view-mathematics.test.tsx(the sanitizer and the View's Island),tests/rich-text-editor-source.test.tsx,tests/rich-text-editor-custom-tool.test.tsx(a custom Tool; test Tools are intests/editor-test-tools.ts),tests/rich-text-editor-custom-ui.test.tsx(Insert items and Block actions of a custom Tool),tests/rich-text-editor-trigger.test.tsx(a custom Trigger character: opening, picking, the query, asynchronous items, set errors),tests/rich-text-editor-custom-button.test.tsx(buttons of a custom Tool),tests/rich-text-editor-custom-markdown.test.tsx(Markdown of a custom Block by default and by its own rules),tests/rich-text-editor-atom-text.test.tsx(Atom text, the count towardmaxLength, emptiness),tests/rich-text-editor-empty-table.test.tsx(an empty table is content),tests/rich-text-editor-max-height.test.tsx(maxHeightandresizable: what is inside the scroll area, the position of the Block handle during scrolling),tests/rich-text-editor-events.test.tsx(onReady,onFocus,onBlur, paste and drop order),tests/rich-text-editor-loaders.test.tsx(Extensions Loaders, "Retry"),tests/rich-text-editor-skeleton.test.tsx(Skeleton),tests/rich-text-editor-emoji.test.tsx(emoji),tests/rich-text-editor-json.test.tsx(JSON),tests/editor-search.test.tsx,tests/editor-search-panel.test.tsxandtests/editor-search-replace.test.tsx(find and replace),tests/rich-text-editor-tool-options.test.tsxandtests/editor-tool-options-types.test.ts(tool()options),tests/rich-text-editor-tool-state.test.tsx,tests/rich-text-editor-tool-state-ssr.test.tsxandtests/editor-tool-state-types.test.ts(state),tests/rich-text-editor-tool-commands.test.tsx,tests/editor-search-commands-reveal.test.tsxandtests/editor-tool-commands-types.test.ts(handle.tool()commands),tests/rich-text-editor-define-tool.test.tsx,tests/editor-define-tool-types.test.tsandtests/editor-define-tool-server.test.tsx(defineTool),tests/rich-text-paper.test.tsx,tests/rich-text-paper-css.test.tsx,tests/editor-entry.test.ts,tests/editor-schema-entry.test.ts,tests/editor-highlight-entry.test.ts; in the browser —tests-visual/interactions.spec.ts("RichTextEditor inside Dialog" — Escape in the style list, in the Slash menu, in the link popover and in the code block language menu; "RichTextEditor inside-dialog" and "inside-drawer" — the "…" menu and the color popovers with mouse and keyboard; "RichTextEditor insert menu"; "RichTextEditor block commands" — real⌥⇧↑/↓,⌘],⌘[and⌘⇧D),tests-visual/rich-text-editor-image.spec.ts(file drag and width handles),tests-visual/rich-text-editor-bubble.spec.ts(the Bubble menu inDialog,Drawerand a scroll container, at the viewport edge, the inverse surface in three themes),tests-visual/rich-text-editor-layout.spec.ts(Column layout in aDialog: columns side by side and Tab across them, arrow keys, a stack on a phone),tests-visual/rich-text-editor-wrapper.spec.ts(Wrapper: a dashed outline in the Editor and no frame inRichTextView, the tone looks the same in both, exit with Enter,↑out of a Wrapper),tests-visual/rich-text-editor-mathematics.spec.ts(formulas: KaTeX rendering with its fonts, the Skeleton, the Popover, the View's Island, axe),tests-visual/rich-text-editor-details.spec.ts(the Details Block: opening in the Editor and inRichTextView, the button from the keyboard),tests-visual/rich-text-editor-block-handle.spec.ts(the handle menu in aDialog:Ctrl/⌘+/, Escape by levels; the handle's position at the Block's first line),tests-visual/rich-text-editor-trigger.spec.ts(a custom Trigger character: the list at the caret, real typing of@, picking by mouse and Enter,a@binside a word, axe in three themes),tests-visual/rich-text-editor-source.spec.ts(Source mode: field height, growth with content, focus on entry and exit),tests-visual/rich-text-editor-height.spec.ts(Field height),tests-visual/rich-text-editor-emoji.spec.ts(emoji),tests-visual/rich-text-editor-skeleton.spec.ts(Skeleton). - The extension API at a glance, "Stability" and recipes — Editor extension API.
- Viewing without editing — RichTextView.
- Storybook:
Inputs/RichTextEditor(theSearchStatusLine,TableOfContentsOptions,TableOfContentsExternalNavigation,ToolCommands,DefinedToolandDefinedToolConfiguredstories;BlockHandleOverRange,BlockHandleOverRangeMenu,BlockSelection,BlockSelectionPaper,BlockSelectionInList,BlockSelectionInColumns,BlockSelectionInDialog,BlockSelectionReadOnlyandBlockSelectionRussianfor Block selection). - Code origin: minimal-tiptap (MIT); syntax highlighting theme colors — highlight.js (BSD-3-Clause); licenses are in the package
NOTICE.
TypeScript types
RichTextEditorProps
Prop
Type