Welcome to Vanilla Breeze
This bell pulls live notifications from /go/notify/messages — the same contract documented at /docs/concepts/service-contracts/. Static articles like this one are the no-JS / no-backend fallback.
vs data-stepper vs
This bell pulls live notifications from /go/notify/messages — the same contract documented at /docs/concepts/service-contracts/. Static articles like this one are the no-JS / no-backend fallback.
When to use vs data-stepper vs
Three tiers of stepper-style input. Pick the lowest tier that does the job — the higher tiers cost more JS and only earn their weight when the lower one cannot reach the use case.
| Tier | What it is | Use when |
|---|---|---|
<input type="number"> |
Native HTML element. UA-rendered spinner buttons, arrow-key step, min / max / step, form validation, numeric mobile keyboard. |
Plain numeric value and the default UA UI is acceptable. |
<input type="number" data-stepper> |
VB upscale. Wraps the native input with custom +/- buttons, hides UA spinners, decimal-aware step math, min/max clamping with disabled-at-bounds. | Plain numeric value, you want consistent VB-styled buttons across browsers. |
<stepper-wc> |
Stepper for values the native number input cannot represent. | Formatted units, currency, percent, time, byte sizes; token-snap design-system scales; discrete enums; long-press acceleration. |
Decision rule: if <input type="number" data-stepper> works,
use it. Reach for <stepper-wc> only when you hit a case the native input
cannot represent.
<input type="number">The browser primitive. Smallest payload, full form participation, validation, and a numeric soft-keyboard on mobile. The downside is the UA-rendered spinner buttons, which differ across browsers and are tiny for touch.
<label for="qty">Quantity</label><input type="number" id="qty" name="qty" min="0" max="99" step="1" value="1">
Reach for this when you do not need consistent buttons across browsers.
data-stepperVB's progressive upscale of <input type="number">. Wraps the input with VB-styled +/- buttons, hides the UA spinners, handles step math without floating-point drift, and disables the buttons at min / max. No new element — same form behaviour, same validation, same value semantics. See the data-stepper attribute reference for details.
<label for="qty">Quantity</label><input type="number" id="qty" name="qty" min="0" max="99" step="1" value="1" data-stepper>
This handles the bread-and-butter cases: cart quantity, settings inputs, scoring tools, basic numeric forms. If your value is a plain number, this is the right tier.
<stepper-wc><stepper-wc> is for values the native number input cannot represent at all. Four cases:
$5.00, 12px, 50%, durations (15:00), byte sizes (2.05 KB). The native input rejects non-numeric characters, so locale-aware Intl.NumberFormat output and unit suffixes belong here.data-values="0,4,8,12,16,24") instead of arithmetic. Useful for design-system spacing or type scales.S / M / L / XL or low / medium / high / critical. Not a number at all.data-accelerate for large ranges where multiple taps would be tedious.<stepper-wc data-min="0" data-max="64" data-suffix="px" value="12"></stepper-wc>
<stepper-wc data-values="0,4,8,12,16,24,32" data-suffix="px" value="16"></stepper-wc>
<stepper-wc data-options="low,medium,high,critical" value="medium"></stepper-wc>
See the <stepper-wc> reference for the full attribute list, keyboard map, and event contract.
Those are visual variants of the same primitive, not different primitives. Add them to data-stepper first (e.g. data-stepper-orient="vertical", data-stepper-size="lg") so the cheaper tier benefits too. Don’t scaffold a new component for a CSS variant.
<input type="number">data-stepper<stepper-wc><form> submission.