V2.0.0
[2.0.0] — 2026-05-03
Added
NumericTextandPatternTextdisplay-only components — render formatted
values as a<span>with no input behavior, SSR-safe.- Subpath exports:
svelte-number-format/numeric,/pattern,/patterns,
/displayfor finer-grained tree-shaking. onValueChangecallback onNumericFormatandPatternFormat, mirroring
thereact-number-formatsignature ({ floatValue, formattedValue, value },
{ event, source }).valueTypeprop and string-value support onNumericFormat
('number' | 'string').customPatternsprop onPatternFormatfor user-defined mask characters.MaskPatternsconstants:PHONE_US,PHONE_INTERNATIONAL,DATE_US,
DATE_ISO,CREDIT_CARD,CREDIT_CARD_AMEX,SSN,ZIP_US,IPV4,
MAC_ADDRESS, and more.- SSR test suite (
src/lib/ssr.spec.ts) running under Node with no DOM. - Form-library integration demos under
/demos: Superforms, Formsnap, Felte. - CI bundle-size check via
size-limit.
Changed
- Rewrote
PatternFormatwith a cursor-aware mask engine that preserves
caret position across input, paste, and backspace events. - Locale resolution is now lazy via
defaultLocale()so components no longer
readnavigator.languageat module import — required for SSR. - Vitest configuration split into
browser(jsdom) andssr(node) projects.
Removed
- BREAKING:
SvelteNumberFormatre-export (useNumericFormat). - BREAKING:
SvelteMaskFormatre-export (usePatternFormat). - BREAKING:
maskprop onPatternFormat(useformat).
See MIGRATION.md for detailed upgrade instructions.
Earlier releases
Releases prior to 2.0.0 are tagged in the git history. See
the releases page
for a per-version summary.