valibot
v1.0.0-beta.3MITTree-shakeableTS ReadyThe modular and type-safe schema library for validating structural data with up to 98% smaller bundle footprint.
97/ 100
Excellent Health
Weekly Downloads
1.9M
Bundle Size (gzip)
1.4 kB(3.9 kB min)
Dependencies
Zero Deps
Last Updated
2025-02-20
SPONSORED CLOUD & DEV TOOLSβ’Google Ads Partner
NPMBot AI Assessment
The tree-shakeable future of schema validation, built specifically for client bundles.
Valibot was built to solve Zod's bundle size problem. By utilizing functional composition (`v.pipe(v.string(), v.email())`), bundlers can tree-shake every unused validator. A simple schema often weighs under 1kB gzipped.
Key Advantages
- β’Granular tree-shaking: typical schemas add less than 1.5kB to client bundles
- β’Blazing-fast parsing speed matching or exceeding Zod
- β’Standard Schema specification compliant (interoperable across tools)
- β’Zero dependencies
Gotchas & Limitations
- β’Slightly more verbose functional syntax compared to Zod method chaining
- β’Smaller third-party plugin ecosystem than Zod
Recommended For:
Client-side form validation where bundle size is strictly audited, Micro-frontends and Edge environments
Avoid If:
Teams already standardized on extensive Zod-specific extensions
FEATURED PARTNERβ’Google Ads Partner
Installation & Quickstart
Package Manager Command
javascriptnpm install valibotvalibot Usage Example
javascriptimport * as v from 'valibot';
const UserSchema = v.object({
name: v.pipe(v.string(), v.minLength(2)),
email: v.pipe(v.string(), v.email())
});
type User = v.InferOutput<typeof UserSchema>;Compare valibot with Alternatives
Recommended Alternatives
SPONSORED SERVERSβ’Google Ads Partner