Form
A wrapper component for building forms with React Hook Form integration, Zod schema validation, and automatic smooth scroll to first error.
import
import { Form } from "@/components/ui/form/form";$
npx @bloomui-react/cli add formform.tsx
Default
Basic Form with submit handler and field inputs.
Schema Validation with Zod
Integrate Zod schemas and zodResolver to validate data types, email formats, and custom error boundaries.
form: anyonSubmit: anyisInvalid: anyformState: anyerrors: anyemail: anyerrorMessage: anymessage: anytype: anyregister: any
Auto Scroll to First Error
Submitting a form with validation errors automatically scrolls the window viewport to center and focus the first invalid field using smooth behavior.
scrollToFirstError: boolean
API Reference
Props — Form
Supported properties for the Form component.
| Prop | Type | Default | Description |
|---|---|---|---|
| scrollToFirstError | boolean | true | Automatically scrolls viewport smoothly to first invalid field input on submit. |