Validation-aware form wrapper
import {Form} from "@peakui/react";
Fields inside a form validate on submit; blocking an invalid submission is the browser's native constraint validation.
<Form validationBehavior="aria" aria-label="Profile">
{/* fields validate on blur and show errors without blocking submit */}
</Form>
<Form aria-label="Profile" className="flex flex-col gap-4">
{/* fields */}
</Form>
| Class | Description |
|---|
.form | The form element |
| Slot | Description |
|---|
[data-slot="form"] | The form element |
| Prop | Type | Default | Description |
|---|
validationErrors | Record<string, string | string[]> | - | Server-side errors keyed by field name |
validationBehavior | "native" | "aria" | "native" | With native, the browser blocks invalid submits (noValidate stays off); with aria, validation is announced without blocking |
onSubmit | (event) => void | - | Native submit handler; read values from the form elements |
...rest | | | Every React Aria Form attribute is accepted |