Methane@methane-ui/*
CSS LayoutsComponentsSkillsTheme BuilderGitHub
← All Components

<mth-rich-editor>

@methane-ui/editor~9.0 KB brotli shell + lazy engine~2.6 KB shell · lazy engine chunk

Form-associated ProseMirror rich-text editor with accessible formatting toolbar (RovingFocusController), @methane-ui/sanitize HTML serialization, and --mth-* token sync.

When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.

Live Interactive Preview

Interactive StageLive Custom Element · <mth-rich-editor> (@methane-ui/editor)
Ready · interact with <mth-rich-editor>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/editor/rich-editor"></script>
<mth-rich-editor></mth-rich-editor>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
namenamestring""Form submission field name.
labellabelstring""Visible and accessible label for the editor.
valuevaluestring""Sanitized HTML document content.
placeholderplaceholderstring""Hint text when document is empty.
requiredrequiredbooleanfalseMarks content required during form validation.
disableddisabledbooleanfalsePrevents editing and form submission.
readonlyreadonlybooleanfalseDisplays content without allowing mutations.

Events

EventDetail TypeDescription
mth-input{ value: string; html: string }Fired synchronously on every ProseMirror document transaction.
mth-change{ value: string; html: string }Fired when edited content blurs or is committed.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowRightltrtoolbar button focusedmoves focus to next toolbar action
ArrowLeftrtltoolbar button focusedmoves focus to next toolbar action

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusdelegatesFocus: true with zero host internals.role (ADR-014).lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
keyboardImplements all 2 APG keyboard transitions across LTR/RTL.mth-rich-editor.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(disabled), :state(readonly), :state(invalid), :state(dirty), :state(touched), :state(focused).Conformance suite
i18nRoutes 10 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test