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

<mth-error-boundary>

@methane-ui/primitives~3.2 KB brotli (primitives + UIElement)~0.9 KB marginal

Captures subtree errors and mth-error events to render a localized declarative fallback.

When NOT to use: Do not use <mth-error-boundary> for expected inline field validation errors; use <mth-field> error messages.

Live Interactive Preview

Interactive StageLive Custom Element · <mth-error-boundary> (@methane-ui/primitives)
Simulate ErrorReset
Protected subtree healthy — click Simulate Error to test declarative fallback.
Ready · interact with <mth-error-boundary>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/primitives"></script>
<mth-error-boundary>Example</mth-error-boundary>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
fallbackMessagefallback-messagestring—Optional fallback error message override.

Events

EventDetail TypeDescription
mth-error-captured{ error: unknown }Dispatched when a subtree error is captured.
mth-resetvoidDispatched when the error boundary resets.

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusFocus ownership matches focusModel="none".lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
i18nRoutes 2 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test