← All Components
<mth-rich-editor>
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
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>import '@methane-ui/editor/rich-editor';
import '@methane-ui/react';
export function Example() {
return <mth-rich-editor></mth-rich-editor>;
}<script setup lang="ts">
import '@methane-ui/editor/rich-editor';
</script>
<template>
<mth-rich-editor></mth-rich-editor>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/editor/rich-editor';
import { MthRichEditorDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthRichEditorDirective],
template: `<mth-rich-editor></mth-rich-editor>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/editor/rich-editor';
import MthRichEditor from '@methane-ui/svelte/MthRichEditor.svelte';
</script>
<MthRichEditor></MthRichEditor>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
name | name | string | "" | Form submission field name. |
label | label | string | "" | Visible and accessible label for the editor. |
value | value | string | "" | Sanitized HTML document content. |
placeholder | placeholder | string | "" | Hint text when document is empty. |
required | required | boolean | false | Marks content required during form validation. |
disabled | disabled | boolean | false | Prevents editing and form submission. |
readonly | readonly | boolean | false | Displays content without allowing mutations. |
Events
| Event | Detail Type | Description |
|---|---|---|
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
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| ArrowRight | ltr | toolbar button focused | moves focus to next toolbar action |
| ArrowLeft | rtl | toolbar button focused | moves focus to next toolbar action |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | delegatesFocus: true with zero host internals.role (ADR-014). | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| keyboard | Implements all 2 APG keyboard transitions across LTR/RTL. | mth-rich-editor.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(disabled), :state(readonly), :state(invalid), :state(dirty), :state(touched), :state(focused). | Conformance suite |
| i18n | Routes 10 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |