← All Components
<mth-plan-picker>
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
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>import '@methane-ui/commerce/plan-picker';
import '@methane-ui/react';
export function Example() {
return <mth-plan-picker billing-cycle="monthly" currency="USD"></mth-plan-picker>;
}<script setup lang="ts">
import '@methane-ui/commerce/plan-picker';
</script>
<template>
<mth-plan-picker billing-cycle="monthly" currency="USD"></mth-plan-picker>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/commerce/plan-picker';
import { MthPlanPickerDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthPlanPickerDirective],
template: `<mth-plan-picker billing-cycle="monthly" currency="USD"></mth-plan-picker>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/commerce/plan-picker';
import MthPlanPicker from '@methane-ui/svelte/MthPlanPicker.svelte';
</script>
<MthPlanPicker billing-cycle="monthly" currency="USD"></MthPlanPicker>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
plans | — | ReadonlyArray<unknown> | — | Array of BillingPlan tier definitions. |
value | value | string | "" | Currently selected plan ID. |
billingCycle | billing-cycle | 'monthly' | 'annual' | "monthly" | Active billing interval: monthly or annual. |
currency | currency | string | "USD" | ISO 4217 currency code passed to Intl.NumberFormat. |
locale | locale | string | "" | Optional BCP 47 locale override; defaults to UIElement resolvedLocale. |
name | name | string | "" | Form field name submitted via FormData. |
label | label | string | "" | Accessible region label overriding localized default. |
disabled | disabled | boolean | false | Disables billing cycle toggle and plan tier selection. |
required | required | boolean | false | Enforces a selected plan tier during constraint validation. |
Events
| Event | Detail Type | Description |
|---|---|---|
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
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| ArrowRight | both | plan card focused | Focus next plan tier card (previous in RTL). |
| ArrowLeft | both | plan card focused | Focus previous plan tier card (next in RTL). |
| Home | both | plan card focused | Focus first plan tier card. |
| End | both | plan card focused | Focus last plan tier card. |
| Enter | both | plan card focused | Select focused plan tier. |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | Focus ownership matches focusModel="host". | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| keyboard | Implements all 5 APG keyboard transitions across LTR/RTL. | mth-plan-picker.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(annual), :state(disabled). | Conformance suite |
| i18n | Routes 9 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |