Dinachi

Form

A native form wrapper with consolidated error handling built on Base UI foundations.

View Source

#Installation

npx @dinachi/cli@latest add form

#Usage

tsx
import { Form } from "@/components/ui/form"

#Examples

#API Reference

PropTypeDefaultDescription
errorsRecord<string, string | string[]>Validation errors returned externally, typically after submission by a server or form action.
onFormSubmit(values: Record<string, FormDataEntryValue>) => voidEvent handler receiving form values as a JavaScript object; calls preventDefault() on submit.
validationMode'onSubmit' | 'onBlur' | 'onChange''onSubmit'Determines when validation occurs. Field-level setting takes precedence.
actionsRefRefObject<Form.Actions | null>Ref to imperative actions for programmatic validation control.