Pliant

Modern validation for JavaScript & TypeScript with rule inheritance, structured errors, and framework adapters.

✨ Framework-Agnostic 🔗 Rule Inheritance 📦 Tree-Shakeable 🎯 TypeScript First ⚡ Zero Dependencies

Interactive Examples

See Pliant in action with our live demos. Try the core vanilla JavaScript example or the Angular integration.

🚀

Core Example

@pliant/core

Pure JavaScript validation with no framework dependencies. See the complete API in action.

  • ✓ Registry-based rule management
  • ✓ Rule inheritance & composition
  • ✓ Dynamic message resolution
  • ✓ Structured error details
  • ✓ 11 built-in validators
View Core Demo →
🅰️

Angular Example

@pliant/angular

Seamless Angular Reactive Forms integration with dependency injection support.

  • ✓ ValidatorFn integration
  • ✓ DI-powered providers
  • ✓ Cross-field validation
  • ✓ Real-time error feedback
  • ✓ Standalone components
View Angular Demo →

Why Pliant?

🧬

Rule Inheritance

Create specialized rules from base rules. Override options, messages, or both without rewriting logic.

📊

Structured Errors

Get rich error objects with rule name, actual vs expected values, and full context for debugging.

🎨

Custom Messages

Use static strings or dynamic functions that receive error details for context-aware messages.

🔌

Framework Adapters

Same validation logic everywhere. Core for vanilla JS, adapters for Angular, React, and more.

⚡

Async Support

Built-in support for async validators. Perfect for server-side checks like username availability.

🪶

Lightweight

Zero runtime dependencies. Tree-shakeable ESM builds. Import only what you use.