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

<mth-quantity-selector>

@methane-ui/commerce~7.9 KB brotli (kit + Lit)~2.0 KB marginal

Form-associated accessible quantity stepper with min/max/step clamping, spinbutton keyboard navigation, and FACE support.

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

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/commerce/quantity-selector"></script>
<mth-quantity-selector value="1" min="1"></mth-quantity-selector>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
valuevaluenumber1Current numeric quantity value.
minminnumber1Minimum allowed quantity.
maxmaxnumber99Maximum allowed quantity.
stepstepnumber1Step increment applied on stepper button or arrow key actions.
namenamestring""Form field name submitted via FormData.
labellabelstring""Accessible group label overriding localized default.
disableddisabledbooleanfalseDisables decrement, input, and increment controls.
requiredrequiredbooleanfalseMarks field required during form constraint validation.

Events

EventDetail TypeDescription
mth-input{ value: number }Emitted event mth-input.
mth-change{ value: number }Emitted event mth-change.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowUpbothspinbutton focusedIncrement quantity by step.
ArrowDownbothspinbutton focusedDecrement quantity by step.
PageUpbothspinbutton focusedIncrement quantity by 10x step.
PageDownbothspinbutton focusedDecrement quantity by 10x step.
Homebothspinbutton focusedJump to minimum quantity.
Endbothspinbutton focusedJump to maximum quantity.

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