Valibot

valibot.dev

Modular schema validation library with a tiny bundle size and TypeScript inference.

Overview

Valibot is an open source schema validation library for TypeScript designed with bundle size, type safety, and developer experience as core priorities. It allows you to create schemas that describe structured data and validate unknown data at runtime while maintaining full type inference.

The library uses a modular API design that enables tree-shaking and code splitting, resulting in a minimal starting bundle size of less than 700 bytes. This makes it particularly well-suited for client-side form validation and serverless environments where bundle size matters.

Key features

  • Fully type safe with static type inference
  • Modular API design for minimal bundle size
  • 100% test coverage
  • Built-in validation and transformation helpers
  • Supports primitive values to complex objects
  • Tree-shakeable and code-splittable
Pros
  • Extremely small bundle size (starts under 700 bytes)
  • Full TypeScript type safety and inference
  • Modular design allows importing only needed functionality
  • 100% test coverage for reliability
  • Great developer experience with minimal, readable API
  • Can reduce bundle size up to 95% compared to alternatives
Cons
  • Smaller ecosystem compared to more established alternatives
  • May require learning a new API if migrating from other schema libraries
Use this if
You need runtime validation of TypeScript data with minimal bundle size impact, especially for client-side or serverless applications.
Skip this if
You require a mature ecosystem with extensive third-party integrations or prefer established schema validation libraries.

Best for

TypeScript projects requiring runtime data validationClient-side form validationServerless environments with bundle size constraintsApplications needing full type safety

Alternatives

ZodYupJoiTypeBox

Compare Valibot alternatives

More Library

Compare all
View React Query
React Query

Data-fetching and state management library designed to handle server state in web applications.

View dotenv
dotenv

Zero-dependency module loading environment variables from .env files into Node.js apps.

View Solidjs
Solidjs

JavaScript library designed for building user interfaces with a focus on declarative syntax and efficiency.

View UnoCSS
UnoCSS

Instant on-demand atomic CSS engine — flexible, fast alternative to Tailwind.