E-commerce quantity picker, a thin variant of <mv-number-field>: minimum 1, automatically capped at stock, an “In stock” / “Only 3 left in stock” / “Out of stock” caption linked to the field, a message and shake when hitting the stock limit, a disabled sold-out state that re-enables on restock; pill and subtle variants for cart lines.
Same as <mv-number-field> (submits an integer value).
min
number
1
Minimum quantity.
max
number
Commercial cap (e.g. 10 per order); combined with stock, the smaller one wins.
stock
number
Available stock: caps the value and drives the caption; 0 = out of stock (disabled).
low-stock
number
5
Threshold for the “Only n left in stock” caption.
caption
auto | none | text
auto
Automatic caption, none, or free text.
data-size
sm | md
Height (lg by default, sized to match an “Add to cart” button).
data-variant
pill | ghost
Rounded pill, or muted background without a border.
disabled / readonly / required
boolean
Form states.
Properties
Name
Type
Description
value
number | null
Quantity.
stock
number
Stock (assignable: restock).
inStock
boolean
Read-only.
strings
Partial<Record<string, string | { one, other }>>
Overrides for the default text (en-US): quantity (default accessible name), inStock, outOfStock, lastOne (stock of 1), onlyLeft (low stock, {n}, { one, other }), maxAvailable (shown at the stock limit, {n}, { one, other }), plus the number-field keys decrease, increase and valueMissing. App-wide translations: setStrings() from core/i18n.js, under the key "quantity". Can be set before the element is defined.
Inherits the APG Spinbutton pattern from <mv-number-field> (arrows, Page↑/↓, Home/End, “Decrease” / “Increase” buttons outside the tab order). Default name “Quantity”. The stock caption is linked via aria-describedby; the “Maximum quantity” message is announced (aria-live polite) when trying to exceed the stock. When out of stock, the field is disabled and empty (dash).