Interface for schema types that support adding custom validation rules. Provides a fluent API for chaining validation rules onto schema types.
const schema = vine.string() .use(minLength({ length: 5 })) .use(customRule({ option: 'value' })) Copy
const schema = vine.string() .use(minLength({ length: 5 })) .use(customRule({ option: 'value' }))
Adds a validation rule to the schema's validation chain. Rules are executed in the order they are added.
The validation rule or rule builder to add
The schema instance for method chaining
schema.use(minLength({ length: 3 }))schema.use(myCustomRule({ strict: true })) Copy
schema.use(minLength({ length: 3 }))schema.use(myCustomRule({ strict: true }))
Interface for schema types that support adding custom validation rules. Provides a fluent API for chaining validation rules onto schema types.
Example