Search for a command to run...
Last updated June 9, 2026
Technical considerations for integrating Ctrovalidate into production environments.
The library is distributed as tree-shakeable ESM. To minimize bundle size, ensure your toolchain supports modern module resolution.
Import symbols directly from the package entry point. Bundlers such as Vite, Rollup, or Webpack 5 will prune unused rule logic and internal utilities.
import { Ctrovalidate } from 'ctrovalidate-browser';The core browser package adds approximately 5KB (gzipped) to the application bundle. All built-in rules are included in this footprint by default.
[!IMPORTANT] Client-side validation is a user experience enhancement. All data must be re-validated on the server or database layer to ensure system integrity.
Ctrovalidate does not modify input values. Separate sanitization steps should be implemented to prevent injection attacks if input values are reflected in the DOM.
When realTime is enabled, the controller attaches blur and input listeners to all discovered fields. For forms exceeding 100 fields on low-memory devices, consider disabling realTime and using manual validate() calls.
In Single Page Applications (SPAs), call .destroy() when the component unmounts to remove event listeners and clear internal state caches.
// Example in a lifecycle hook
validator.destroy();The library manages the following ARIA attributes automatically:
aria-invalid="true/false": Applied based on validation state.aria-describedby: Linked to the error container ID if present.