← All packages@ebdev/ngx-smart-validators · Angular 17–22

ngx-smart-validators

Tree-shakeable validators for reactive and template-driven forms — numbers, strings, dates, formats and normalising transforms free, with a scored password engine, credit card and IBAN checks, age rules, cross-field validation and metadata-accurate international phone numbers on a licence. Works with Angular 17 through 22.

npm install @ebdev/ngx-smart-validators

Free

  • Numbers, ranges, alpha, alphanumeric, whitespace
  • Regex, starts/ends/includes, URL, strict email
  • Valid, min, max, past and future dates
  • UUID, JSON, base64, hex colour, IP, latitude, longitude
  • Basic phone-number shape
  • Normalising transforms — case, int, float, oneOf
  • Password confirmation (matchFields)
  • Template-driven directives and the message system
  • Tree-shakeable — you ship only what you import

Premium

  • Scored password-strength engine
  • Credit card and IBAN validation
  • Minimum and maximum age from a date of birth
  • Cross-field rules — date range, requiredIf, atLeastOne, allOrNone
  • Metadata-accurate international phone numbers

Questions

Does it work with both reactive and template-driven forms?
Yes. Every validator ships as a ValidatorFn for reactive forms and as a standalone directive for template-driven forms — import them one by one or all at once via NGV_DIRECTIVES.
Which Angular versions does it support?
Angular 17 through 22 — the widest range in the catalogue, so it works in apps that have not yet left 17.
What is free and what needs a licence?
Number, string, date, UUID, JSON and IP validators plus normalising transforms are free. A licence adds the scored password engine, credit card and IBAN checks, age rules, cross-field validation and metadata-accurate international phone validation.
What happens if a licence key is invalid or expired?
The library falls back to the free tier without breaking the form. Verification is offline; keys can be restricted by hostname and expiry, and local development hosts always work without one.
Does it add much to the bundle?
The package is tree-shakeable: each validator is a separate export, so the bundle carries only the validators you actually import.