Vest Tutorials
Start with a small suite, or jump straight to the problem you are trying to solve. The examples cover focused validation, async checks, conditional fields, schemas, and sharing validation between the browser and server.
One API detail is worth knowing before you begin:
- Use
suite.run(data)for stateful application validation. - Use
suite.runStatic(data)for an independent server request or isolated execution. - Pass the suite itself to a library that supports Standard Schema. The
~standard.validatehook is for those integrations, not for calling directly in application code.
Pick a tutorial​
| Tutorial | Example | What it covers |
|---|---|---|
| Write your first suite | Signup | create, test, enforce, and result selectors |
| Validate one field without forgetting the rest | Profile form | Focused runs and retained results |
| Handle async checks safely | Username availability | Pending state, cancellation, and race safety |
| Avoid repeated async work | Coupon check | memo, debounce, and AbortSignal |
| Show warnings without blocking submission | Password strength | Errors, warnings, pending, and untested state |
| Skip or remove conditional rules | Pickup and delivery | skipWhen, omitWhen, and optional |
| Validate a multi-step form | Onboarding | Groups, step validity, and cross-field rules |
| Parse input and keep the typed result | Registration | Parsing, type inference, and Standard Schema |
| Share validation between server and client | Server validation and browser resume | runStatic, serialization, and resumption |
| Write rules for your own domain | Custom Enforce rules | condition, enforce.extend, and sibling context |
A good order for learning Vest​
If Vest is new to you, read the first three in order. They introduce suites, focused runs, and async validation—the ideas most of the other guides build on. After that, choose the examples that match your application.
See everything working together​
- Open the complete registration example for a runnable React application.
- Read Vest, schema validators, and form libraries to decide which tool should handle each part of your form.
- Check when not to use Vest if your validation is simple or only runs once.