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

<mth-mfa-challenge>

@methane-ui/auth~9.0 KB brotli (kit + Lit)~2.6 KB marginal

Multi-factor authentication challenge supporting 6-digit TOTP entry with multi-cell paste and backup recovery code entry.

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-mfa-challenge> (@methane-ui/auth)
Ready · interact with <mth-mfa-challenge>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/auth/mfa-challenge"></script>
<mth-mfa-challenge mode="totp" length="6"></mth-mfa-challenge>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
modemode'totp' | 'backup'"totp"Active challenge verification mode (totp | backup).
lengthlengthnumber6Number of TOTP digit cells.
valuevaluestring""Current entered verification or backup code.
namenamestring""Form field name submitted via ElementInternals.
errorerrorstring""External verification error message.
loadingloadingbooleanfalseDisables controls and shows verification submission progress.
disableddisabledbooleanfalseDisables code entry and action buttons.
requiredrequiredbooleantrueWhether a complete verification code is required for form validity.
allowResendallow-resendbooleanfalseWhether to display a resend code button.

Events

EventDetail TypeDescription
mth-input{ value: string; mode: string }Emitted on code input.
mth-change{ value: string; mode: string }Emitted on code commit.
mth-complete{ value: string; mode: string }Emitted when all TOTP digits are entered.
mth-submit{ value: string; mode: string }Emitted when verification is submitted.
mth-resendvoidEmitted when the user requests a new code.
mth-mode-change{ mode: string }Emitted when toggling between totp and backup modes.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowRightltrTOTP cell focusedMoves focus to next digit cell
ArrowLeftrtlTOTP cell focusedMoves focus to next digit cell in RTL
BackspacebothEmpty TOTP cell focusedClears previous digit and focuses it

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 3 APG keyboard transitions across LTR/RTL.mth-mfa-challenge.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(disabled), :state(invalid), :state(loading).Conformance suite
i18nRoutes 12 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test