Vanilla Breeze v0.7.4

Vanilla Breeze v0.7.4 released

0.7.4 gives the Ambient pack weather. A page names one feed URL on its own site, and the pack sets data-weather from it, uses its sunrise and sunset for dawn and dusk, and never shows a stale observation. Helpers for producing the feed from Open-Meteo are included. Ambient p…

Read the release notes

min / max / step

Range and increment constraints for number, range, date and time inputs. Covers step bases, step='any', the range defaults and Vanilla Breeze's stepper and slider enhancements.

Overview

min and max set the lowest and highest allowed value; step sets the allowed increment. A value outside the range is rangeUnderflow or rangeOverflow, a value between steps is stepMismatch, and any of them blocks submission. The same attributes drive the arrow keys, the spin buttons and the slider.

Applies to: <input> of type number, range, date, month, week, time and datetime-local. (<meter> and <progress> have their own min/max, which describe a gauge, not a constraint.)

Values

min and max take a value in the input's own format: a number, 2026-11-09, 2026-11, 2026-W46, 17:00 or 2026-11-09T17:00. A value that doesn't parse is ignored.

Typestep unitDefault stepDefault min / max
number11none
range110 / 100
datedays1 daynone
monthmonths1 monthnone
weekweeks1 weeknone
time, datetime-localseconds60 secondsnone
  • step="any" allows any value; no stepMismatch.
  • Steps count from the step base: min if set, otherwise the value attribute, otherwise 0. With min="1" step="2", 1, 3 and 5 are valid and 2 is not.
  • A missing, zero, negative or unparsable step uses the default.

Examples

Money

Without step="0.01", the default step of 1 makes 4.50 invalid.

Slider with labelled stops

Overnight time range

For time inputs, a min later than max is allowed and means the range crosses midnight: min="22:00" max="06:00" accepts 23:30 and 02:00.

In Vanilla Breeze

  • data-stepper on a number input adds − and + buttons that call the native stepUp() / stepDown(), so min, max, step and the step base behave exactly as the arrow keys do. A button disables itself at its limit, and both lock when the input is disabled or read-only. The native spin buttons are hidden only once the stepper has upgraded (src/utils/number-init.js, src/native-elements/input/styles.css).
  • Range styling. Every input[type="range"] gets a token-driven track and thumb (--range-track-h, --range-track-bg, --range-track-fill, --range-thumb-size, --range-thumb-bg, --range-thumb-border in src/tokens/forms.css; rules in src/native-elements/input/range.css). The filled part runs to --range-pct and flips under dir="rtl".
  • data-range reads min, max and step to position a value bubble (data-bubble), draw a mark per step (data-markers, skipped above 100 steps) and set aria-valuetext with a locale-formatted value (src/utils/range-init.js).
  • Error styling. VB has no :out-of-range rule of its own. An out-of-range or off-step value is invalid, so it gets the standard :user-invalid border, and data-message-rangeunderflow, -rangeoverflow and -stepmismatch set the message in output.error.
  • Components. <date-picker> and <time-picker> read min and max from the input they wrap and have their own range messages; <stepper-wc> uses data-min, data-max and data-step.

Accessibility

  • State the range and the increment in a visible hint. Neither the spin buttons nor the date picker tell users the limits until they fail.
  • A range slider with no visible value is hard to use precisely. Show the value (data-bubble, or an <output>) and consider a number input for exact entry.
  • data-range sets aria-valuetext, so a screen reader hears "$500" or "Medium" rather than a bare number.

Gotchas

  • Range inputs never underflow or overflow. The browser clamps the value to min–max and the nearest step, so rangeUnderflow applies only to the other types. A range's default value is the midpoint.
  • For range, a max below min is treated as equal to min.
  • max is reached only if it lies on a step. With min="0" max="10" step="3", the highest valid value is 9.
  • Values set by script are not clamped (except on range inputs); they can be invalid without the user doing anything.
  • Constraints are checked in the browser only. Check them again on the server.

Related

Which to choose

  • type="number" + min/max/step — an exact quantity; add data-stepper for large touch targets.
  • type="range" + data-range — an approximate value where the position matters more than the number.
  • <date-picker> / <time-picker> — dates and times that need a consistent, localised picker across browsers.
  • inputmode="numeric" + pattern — digits that aren't a quantity (PINs, codes); min/max don't apply.
↑