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

<mth-markdown-editor>

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

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

Interactive StageLive Custom Element · <mth-markdown-editor> (@methane-ui/editor)
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>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
namenamestring""name property.
labellabelstring""label property.
valuevaluestring""value property.
placeholderplaceholderstring""placeholder property.
modemode'write' | 'preview' | 'split'"write"mode property.
allowRawHtmlallow-raw-htmlbooleanfalseallowRawHtml property.
requiredrequiredbooleanfalserequired property.
disableddisabledbooleanfalsedisabled property.
readonlyreadonlybooleanfalsereadonly property.

Events

EventDetail TypeDescription
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

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-markdown-editor.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(disabled), :state(readonly), :state(invalid), :state(split), :state(dirty), :state(touched), :state(focused).Conformance suite
i18nRoutes 13 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test