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

<mth-plan-picker>

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

Form-associated SaaS subscription plan picker with monthly/annual billing toggle, SelectionController + RovingFocusController, and Intl currency formatting.

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

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/commerce/plan-picker"></script>
<mth-plan-picker billing-cycle="monthly" currency="USD"></mth-plan-picker>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
plans—ReadonlyArray<unknown>—Array of BillingPlan tier definitions.
valuevaluestring""Currently selected plan ID.
billingCyclebilling-cycle'monthly' | 'annual'"monthly"Active billing interval: monthly or annual.
currencycurrencystring"USD"ISO 4217 currency code passed to Intl.NumberFormat.
localelocalestring""Optional BCP 47 locale override; defaults to UIElement resolvedLocale.
namenamestring""Form field name submitted via FormData.
labellabelstring""Accessible region label overriding localized default.
disableddisabledbooleanfalseDisables billing cycle toggle and plan tier selection.
requiredrequiredbooleanfalseEnforces a selected plan tier during constraint validation.

Events

EventDetail TypeDescription
mth-change{ planId: string; billingCycle: "monthly" | "annual" }Emitted event mth-change.
mth-cycle-change{ billingCycle: "monthly" | "annual" }Emitted event mth-cycle-change.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowRightbothplan card focusedFocus next plan tier card (previous in RTL).
ArrowLeftbothplan card focusedFocus previous plan tier card (next in RTL).
Homebothplan card focusedFocus first plan tier card.
Endbothplan card focusedFocus last plan tier card.
Enterbothplan card focusedSelect focused plan tier.

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusFocus ownership matches focusModel="host".lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
keyboardImplements all 5 APG keyboard transitions across LTR/RTL.mth-plan-picker.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(annual), :state(disabled).Conformance suite
i18nRoutes 9 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test