← All Components
<mth-quantity-selector>
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
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>import '@methane-ui/commerce/quantity-selector';
import '@methane-ui/react';
export function Example() {
return <mth-quantity-selector value="1" min="1"></mth-quantity-selector>;
}<script setup lang="ts">
import '@methane-ui/commerce/quantity-selector';
</script>
<template>
<mth-quantity-selector value="1" min="1"></mth-quantity-selector>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/commerce/quantity-selector';
import { MthQuantitySelectorDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthQuantitySelectorDirective],
template: `<mth-quantity-selector value="1" min="1"></mth-quantity-selector>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/commerce/quantity-selector';
import MthQuantitySelector from '@methane-ui/svelte/MthQuantitySelector.svelte';
</script>
<MthQuantitySelector value="1" min="1"></MthQuantitySelector>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
value | value | number | 1 | Current numeric quantity value. |
min | min | number | 1 | Minimum allowed quantity. |
max | max | number | 99 | Maximum allowed quantity. |
step | step | number | 1 | Step increment applied on stepper button or arrow key actions. |
name | name | string | "" | Form field name submitted via FormData. |
label | label | string | "" | Accessible group label overriding localized default. |
disabled | disabled | boolean | false | Disables decrement, input, and increment controls. |
required | required | boolean | false | Marks field required during form constraint validation. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-input | { value: number } | Emitted event mth-input. |
mth-change | { value: number } | Emitted event mth-change. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| ArrowUp | both | spinbutton focused | Increment quantity by step. |
| ArrowDown | both | spinbutton focused | Decrement quantity by step. |
| PageUp | both | spinbutton focused | Increment quantity by 10x step. |
| PageDown | both | spinbutton focused | Decrement quantity by 10x step. |
| Home | both | spinbutton focused | Jump to minimum quantity. |
| End | both | spinbutton focused | Jump to maximum quantity. |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | delegatesFocus: true with zero host internals.role (ADR-014). | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| keyboard | Implements all 6 APG keyboard transitions across LTR/RTL. | mth-quantity-selector.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(disabled), :state(min), :state(max). | Conformance suite |
| i18n | Routes 6 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |