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

<mth-price-display>

@methane-ui/commerce~6.8 KB brotli (kit + Lit)~1.4 KB marginal

Locale-aware currency price formatter supporting compare-at pricing, discount badges, and billing cadence.

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

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/commerce/price-display"></script>
<mth-price-display amount="0" compare-at-amount="null"></mth-price-display>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
amountamountnumber0Numeric monetary amount.
compareAtAmountcompare-at-amountnumber | nullnullOptional original price shown struck through when higher than amount.
currencycurrencystring"USD"ISO 4217 currency code passed to Intl.NumberFormat.
localelocalestring""Optional BCP 47 locale override; defaults to UIElement resolvedLocale.
periodperiodstring""Optional recurring billing period suffix (e.g., /mo).
showDiscountBadgeshow-discount-badgebooleantrueDisplays percentage savings badge when compareAtAmount exceeds amount.

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
statesExposes ElementInternals CustomStateSet flags: :state(on-sale), :state(free).Conformance suite
i18nRoutes 3 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test