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

<mth-payment-form>

@methane-ui/commerce~10.1 KB brotli (kit + Lit)~3.2 KB marginal

Form-associated payment card entry form using MaskAndFormatEngine + Luhn validation, proper cc-* autocomplete hints, and non-PAN submission detail.

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

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/commerce/payment-form"></script>
<mth-payment-form amount="0" currency="USD"></mth-payment-form>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
valuevaluestring""Form-associated cardholder name value submitted in FormData.
namenamestring""Form field name submitted via FormData.
amountamountnumber0Optional order total formatted onto the submit CTA.
currencycurrencystring"USD"ISO 4217 currency code passed to Intl.NumberFormat.
localelocalestring""Optional BCP 47 locale override; defaults to UIElement resolvedLocale.
submitLabelsubmit-labelstring""Overrides localized submit button label.
disableddisabledbooleanfalseDisables all payment inputs and submit action.
requiredrequiredbooleanfalseEnforces required cardholder constraint validation.

Events

EventDetail TypeDescription
mth-change{ cardholderName: string; last4: string; valid: boolean }Emitted event mth-change.
mth-submit{ cardholderName: string; last4: string; expiry: string; valid: boolean }Emitted event mth-submit.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
Enterbothinput focusedValidate and submit payment form.

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