Form
Form component - form validation system based on react-hook-form and zod
案例展示
表单在实际场景中的使用示例
登录表单
Sign In
注册表单
Create Account
丰富形态
不同布局和样式的表单
个人资料表单 - 双列布局
Edit Profile
Update your personal information
联系表单 - Regular 形状
Get in Touch
Send us a message and we'll get back to you
订阅表单 - 带复选框组
Stay Updated
Join our mailing list
内联表单 - 紧凑布局
覆盖样式
通过 className 自定义表单外观
Join the Club
Quick Feedback
Newsletter
Search
表单组件
Form 组件包含以下子组件
FormProvider wrapper for react-hook-form
FormFieldWraps Controller, provides field context
FormItemForm item container with spacing
FormLabelLabel with handwritten font style
FormControlControl wrapper, binds aria attributes
FormDescriptionField description / helper text
FormMessageValidation error message
使用提示
表单开发最佳实践
Validation Timing
- • Use
onBlurmode for instant validation - • Use
onSubmitmode to reduce interruptions - • Consider step-by-step validation for complex forms
Accessibility
- • FormControl automatically binds aria attributes
- • Error messages are linked to input fields
- • Supports keyboard navigation