Overview
A validator is (value, signal?) => string | null | Promise<…>. Built-ins are factories: call them to get the function. Message is always the last optional argument.
On formAtom / useForm, validators must be sync. On schema / validateObject, they may return a Promise and receive an AbortSignal — see Async Validation.
This page lists everything re-exported from lib/index.ts. Additional factories exist under lib/Mutables/form/validators.ts but are not public until exported.
Where validators run
|
Context
|
Async?
|
Signal
|
|---|---|---|
formAtom
| Sync only | Promise throws |
validateObject / schema
| Async OK | Second arg AbortSignal |
Not public (source only)
Present in lib/Mutables/form/validators.ts but omitted from
lib/index.ts: isUrl,
isGoodPassword / isStrongPassword /
isStrongestPassword, hasCapitalLetter /
hasLowercaseLetter / hasNumber /
hasSpecialCharacter, isFloat /
isInteger / isPositive /
isNegative, isGreaterThan /
isLessThan / isBetween /
isDateBetween, date helpers (isAfter,
isBefore, isPast, isFuture,
isInTheLast24Hours, …), and all check*
boolean utilities. Standalone toFloat /
toValidNumber / toFloatString are also
source-only — use FormAtom methods.
Public catalog (playground)
isEmail, isPattern, min/max length, numeric bounds, isOneOf, withMessage.
Custom validators
Any (value) => string | null works alongside factories. Return null when valid.