Skip to content

CtrovalidateModern Form Validation for the Web.

Lightweight, accessible-by-default, and zero-dependency. Define rules in HTML, handle the rest in JS.

Ctrovalidate Logo

Declarative. Reliable. Accessible. โ€‹

Validation shouldn't be a chore. Ctrovalidate allows you to describe what you want, leaving the how to us.

html
<!-- Define rules directly in HTML -->
<input 
  type="email" 
  name="user_email"
  data-ctrovalidate-rules="required|email"
  data-ctrovalidate-on="input" 
/>

<!-- Errors are handled automatically -->
<div class="error-container"></div>
javascript
import { Ctrovalidate } from 'ctrovalidate';

// One line to initialize
const validator = new Ctrovalidate(document.querySelector('form'));

// Promise-based validation
const isValid = await validator.validate();

Works with your favorite tools โ€‹

Ctrovalidate is tool-agnostic and designed to fit perfectly into your existing stack.

FrameworksStylesTools
Next.js / ReactTailwind CSSVite / Webpack
Nuxt / Vue.jsCSS ModulesTypeScript
SvelteKit / SvelteVanilla CSSJSDoc
Alpine.js / HTMXBootstrapRollup / Esbuild

Ready to build better forms? โ€‹

Join developers building accessible and performant web applications with Ctrovalidate.

Get Started in 5 Minutes ยท Browse API Reference

Released under the MIT License.