← All Components
<mth-math-editor>
Form-associated LaTeX formula editor with quick-symbol toolbar, KaTeX rendering, sanitized preview, and token synchronization.
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-math-editor>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/editor/math-editor"></script>
<mth-math-editor display-mode></mth-math-editor>import '@methane-ui/editor/math-editor';
import '@methane-ui/react';
export function Example() {
return <mth-math-editor display-mode></mth-math-editor>;
}<script setup lang="ts">
import '@methane-ui/editor/math-editor';
</script>
<template>
<mth-math-editor display-mode></mth-math-editor>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/editor/math-editor';
import { MthMathEditorDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthMathEditorDirective],
template: `<mth-math-editor display-mode></mth-math-editor>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/editor/math-editor';
import MthMathEditor from '@methane-ui/svelte/MthMathEditor.svelte';
</script>
<MthMathEditor display-mode></MthMathEditor>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. |
displayMode | display-mode | boolean | true | displayMode 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-error | { message: string } | Emitted event mth-error. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| ArrowRight | ltr | symbol button focused | moves focus to next symbol button |
| ArrowLeft | rtl | symbol button focused | moves focus to next symbol button |
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-math-editor.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(disabled), :state(readonly), :state(invalid), :state(display-mode), :state(dirty), :state(touched), :state(focused). | Conformance suite |
| i18n | Routes 13 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |