Props
| Name | Description |
|---|---|
disableSubmitLock Type: booleanDefaultfalse | Keeps the fields editable while a The lock is the right default: a value edited during the save is not the one that was sent. Turn it off for a background autosave the user should keep typing through. It lifts the read-only part only: the submit button that submitted still spins while the save is pending, and |
fieldErrors Type: Record<string, unknown> | null | Server validation errors by field path (Inertia's |
id Type: string | Lets anything outside the form read and drive it through The id is for |
keepValuesOnUnmount Type: boolean | Ref<boolean, boolean> | Keep a field's value (and its place in A field that stops applying for good (not a step you left) still keeps its value: call |
model Type: Record<string, any> | The object the fields edit in place ( The form fills this object in place; it emits no |
schema Type: MaybeRef<S | undefined> | One Standard Schema for the form (Zod, Valibot, ArkType, Yup, Joi, Effect), passed as is. An issue lands on the field whose Give each type its message too ( |
validationMode Type: ValidationMode | When the fields inside validate as the user works: The five modes, and when to pick each, are in the Validated forms guide. |
Events
| Name | Description |
|---|---|
invalid Type: (payload: BbFormInvalidPayload): void | Fired when a submit fails validation ( |
submit Type: (values: BbFormSubmitValues<S>, meta: BbFormSubmitMeta): void | Fired only when every field passes. Carries the values — with a schema, its parsed OUTPUT (transforms and coercions applied), typed from it. Return the request promise and the form locks until it settles: fields read-only, the submit button that submitted spinning (a submit from code spins none: the button calling |
Slots
The listed properties are the ones exposed to the slot scope.
| Name | Description |
|---|---|
default Type: { touched: boolean; dirty: boolean; valid: boolean; pending: boolean; initialValues?: Partial<GenericObject> | undefined; errors: Record<string, string[]>; fields: Record<string, BbFormFieldEntry>; isSubmitting: boolean; removeField: (path: string) => void; resetForm: (state?: Partial<FormState<GenericObject>> | undefined, opts?: Partial<ResetFormOpts> | undefined) => void; setErrors: (serverErrors: BbFormServerErrors, options?: BbFormSetErrorsOptions) => void; snapshot: (next?: Record<string, unknown> | undefined) => void; submitCount: number; unmatchedErrors: Record<string, string[]>; validate: (opts?: Partial<ValidationOptions> | undefined) => Promise<FormValidationResult<GenericObject, GenericObject>>; values: GenericObject; } |
|
Exposed methods
| Name | Description |
|---|---|
$el Type: HTMLFormElement | null |
Renamed and removed
Names from v2 and from earlier 3.0 betas that no longer work, and what to write instead.
modelValuemodelfails silently