Form Validation

Form Validation

Guides an AI agent to build robust form validation with React Hook Form, Formik and Vee-Validate, including real-time errors and server-side validation sync.

Skill files7 files

references/

templates/

SKILL.md90 lines
1
---
2
name: form-validation
3
description: >
4
Implement form validation using React Hook Form, Formik, Vee-Validate, and
5
custom validators. Use when building robust form handling with real-time
6
validation.
7
---
8
9
# Form Validation
10
11
## Table of Contents
12
13
- [Overview](#overview)
14
- [When to Use](#when-to-use)
15
- [Quick Start](#quick-start)
16
- [Reference Guides](#reference-guides)
17
- [Best Practices](#best-practices)
18
19
## Overview
20
21
Implement comprehensive form validation including client-side validation, server-side synchronization, and real-time error feedback with TypeScript type safety.
22
23
## When to Use
24
25
- User input validation
26
- Form submission handling
27
- Real-time error feedback
28
- Complex validation rules
29
- Multi-step forms
30
31
## Quick Start
32
33
Minimal working example:
34
35
```typescript
36
// types/form.ts
37
export interface LoginFormData {
38
email: string;
39
password: string;
40
rememberMe: boolean;
41
}
42
43
export interface RegisterFormData {
44
email: string;
45
password: string;
46
confirmPassword: string;
47
name: string;
48
terms: boolean;
49
}
50
51
// components/LoginForm.tsx
52
import { useForm, SubmitHandler } from 'react-hook-form';
53
import { LoginFormData } from '../types/form';
54
55
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
56
57
export const LoginForm: React.FC = () => {
58
const {
59
register,
60
handleSubmit,
61
// ... (see reference guides for full implementation)
62
```
63
64
## Reference Guides
65
66
Detailed implementations in the `references/` directory:
67
68
| Guide | Contents |
69
|---|---|
70
| [React Hook Form with TypeScript](references/react-hook-form-with-typescript.md) | React Hook Form with TypeScript |
71
| [Formik with Yup Validation](references/formik-with-yup-validation.md) | Formik with Yup Validation |
72
| [Vue Vee-Validate](references/vue-vee-validate.md) | Vue Vee-Validate |
73
| [Custom Validator Hook](references/custom-validator-hook.md) | Custom Validator Hook |
74
| [Server-Side Validation Integration](references/server-side-validation-integration.md) | Server-Side Validation Integration |
75
76
## Best Practices
77
78
### ✅ DO
79
80
- Follow established patterns and conventions
81
- Write clean, maintainable code
82
- Add appropriate documentation
83
- Test thoroughly before deploying
84
85
### ❌ DON'T
86
87
- Skip testing or validation
88
- Ignore error handling
89
- Hard-code configuration values
90

© AJ Geddes · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 13,607 prompts

More by @OpenSourceBuffGuy

See all
Anime Character Intro from Boots to Hero Pose prompt image

Anime Character Intro from Boots to Hero Pose

Generates a 15-second character introduction from a reference image, moving from a detail close-up to a back view, a face portrait and a full-body hero shot.

video-prompt, anime, character-consistency, reference-image, image-to-video, timed-beats, multi-shot, camera-movement, cinematic, placeholders, hailuo, close-up, full-body, low-angle, character-design, slow-motion, scene-transitions, tracking-shot, structured-output, game-assets

Family Photo Turned Into Gouache Storybook Illustration prompt image

Family Photo Turned Into Gouache Storybook Illustration

Turns an uploaded family photo into a hand-painted gouache storybook illustration while preserving identities, poses and composition, with a detailed avoid list.

image-prompt, json-prompt, reference-image, style-transfer, structured-output, negative-prompt, placeholders, guardrails, gpt-image, painting, illustration, storybook, picture-book, pastel, muted-colors, soft-lighting, natural-light, cozy, whimsical, group-photo, for-artists, long-form, photo-editing, gouache

Photo to Folk-Art Christmas Card prompt image

Photo to Folk-Art Christmas Card

Turns an uploaded photo of a person into a hand-drawn naive folk-art Christmas greeting card in a fixed holiday palette, keeping face, kit and pose.

image-prompt, reference-image, style-transfer, photo-editing, christmas, holiday, football, sports, illustration, flat-design, vintage, invitation, greetings, limited-palette, portrait, negative-prompt, structured-output, for-artists, for-designers, gpt-image, storybook, cottagecore, long-form, whimsical

Reviews

Loading reviews…

Discussion

Loading comments…