Usage
@prepared911/ui is a native form plus labeled fields. Form (@prepared911/ui/form) owns submit, pending, and the error summary. Field (@prepared911/ui/field) owns the label, the control, description, and error. Page, dialog, and drawer chrome are blocks: FormLayoutStandard, FormLayoutSectioned, FormLayoutDrawer, and FormDialog.
The feature owns the schema. Pass the validated submit handler into onSubmit. The design system does not wrap react-hook-form.
FormLayoutStandard.FormDialog.FormLayoutDrawer.FormLayoutSectioned.Switch or another control directly.Field only formats the control.onSubmit runs for every submit that passes native validation. If it returns a promise, the form is pending until the promise settles, unless pending is controlled. Repeat submits are ignored while pending. Read that state with useFormPending() and set loading on the Save button.
Save is not disabled just because nothing changed.
Set errorSummary to localized copy when the attempt failed. By default, focus moves to the first control marked invalid. Field-level errors stay on Field.