← All Components
<mth-markdown-editor>
Form-associated Markdown editor with roving formatting toolbar, write/preview/split modes, and sanitized preview rendering.
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-markdown-editor>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/editor/markdown-editor"></script>
<mth-markdown-editor mode="write"></mth-markdown-editor>import '@methane-ui/editor/markdown-editor';
import '@methane-ui/react';
export function Example() {
return <mth-markdown-editor mode="write"></mth-markdown-editor>;
}<script setup lang="ts">
import '@methane-ui/editor/markdown-editor';
</script>
<template>
<mth-markdown-editor mode="write"></mth-markdown-editor>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/editor/markdown-editor';
import { MthMarkdownEditorDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthMarkdownEditorDirective],
template: `<mth-markdown-editor mode="write"></mth-markdown-editor>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/editor/markdown-editor';
import MthMarkdownEditor from '@methane-ui/svelte/MthMarkdownEditor.svelte';
</script>
<MthMarkdownEditor mode="write"></MthMarkdownEditor>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
name | name | string | "" | name property. |
label | label | string | "" | label property. |
value | value | string | "" | value property. |
placeholder | placeholder | string | "" | placeholder property. |
mode | mode | 'write' | 'preview' | 'split' | "write" | mode property. |
allowRawHtml | allow-raw-html | boolean | false | allowRawHtml property. |
required | required | boolean | false | required property. |
disabled | disabled | boolean | false | disabled property. |
readonly | readonly | boolean | false | readonly property. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-input | { value: string } | Emitted event mth-input. |
mth-change | { value: string } | Emitted event mth-change. |
mth-mode-change | { mode: unknown } | Emitted event mth-mode-change. |
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-markdown-editor.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(disabled), :state(readonly), :state(invalid), :state(split), :state(dirty), :state(touched), :state(focused). | Conformance suite |
| i18n | Routes 13 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |