Getting Started
Foundations
Components
#Installation
npx @dinachi/cli@latest add form#Usage
tsx
import { Form } from "@/components/ui/form"#Examples
Default Form
A basic form with field components
Form with Validation
Form with error handling on submit
Contact Form
A complete contact form with multiple field types
#API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| errors | Record<string, string | string[]> | {} | Object keyed by field name with validation messages. |
| onClearErrors | (errors: Record<string, string | string[]>) => void | — | Callback fired when errors should be cleared. |
| onSubmit | (event: React.FormEvent<HTMLFormElement>) => void | — | Form submit handler. |
| render | React.ReactElement | ((props, state) => React.ReactElement) | <form /> | Optional custom render element using Base UI's render pattern. |