API reference

Forms

Rules, submit handling, schema-driven forms and the input helpers behind every Base field.

The Forms guide walks through a complete form.

useFormRules()

Reusable Vuetify rules with translated messages: required, accepted, email, phone, url, numeric, integer, positive, min, max, minLength, maxLength, pattern, password, sameAs.

composables/useFormRules.ts
useFormRules(): { required: (message?: string) => ValidationRule; accepted: (message?: string) => ValidationRule; email: (message?: string) => ValidationRule; phone: (message?: string) => Validat…
ReturnsrequiredacceptedemailphoneurlnumericintegerpositiveminmaxminLengthmaxLengthpatternpasswordsameAs

useFormSubmit()

Validates, focuses the first error, prevents double submits and maps server errors to fields.

composables/useFormSubmit.ts
useFormSubmit(values: MaybeRefOrGetter<TValues>, onSubmit: (values: TValues) => Promise<TResult>, options: UseFormSubmitOptions<TResult> = {}): { formRef: any; isSubmitting: any; isSuccess: any; formError: any; fieldErrors: any; errorCount: any; submit: () => Promise<boolean>; focusNextError: () => Promise<void>; resetVal…
ReturnsformRefisSubmittingisSuccessformErrorfieldErrorserrorCountsubmitfocusNextErrorresetValidation

useSubmitErrors()

resolveSubmitError(error) turns any error into { message, fieldErrors }, for BaseForm.setErrors().

composables/useFormSubmit.ts
useSubmitErrors(): { resolveSubmitError: (error: unknown) => { message: any; fieldErrors: { [k: string]: any[]; }; }; }
ReturnsresolveSubmitError

focusInvalidField()

Focuses the n-th invalid field inside a form element.

composables/useFormSubmit.ts
focusInvalidField(root: HTMLElement | null | undefined, index = 0): Promise<void>

useFormValidation()

The validation engine of BaseForm: resolves rule specs, collects errors and tells whether a field is required.

composables/useFormValidation.ts
useFormValidation(): { isEmpty: any; resolveRules: (field: FormField, values: FormValues) => ((value: unknown) => string | true)[]; fieldErrors: (field: FormField, values: FormValues) => string[]; col…
ReturnsisEmptyresolveRulesfieldErrorscollectErrorsisRequired

useFormSchema()

Schema helpers of BaseForm: visible sections and fields, column sizes, default and initial values, section status.

composables/useFormSchema.ts
useFormSchema(): { normalizeSections: (fields?: FormField[], sections?: FormSection[]) => FormSection[]; resolveSections: (sections: FormSection[], values: FormValues) => FormSection[]; sectionFie…
ReturnsnormalizeSectionsresolveSectionssectionFieldsresolveFlagfieldColsdefaultValueinitialValuessectionStatus

useFormSectionStatus()

Texts, states and progress of form sections for steps, tabs and the aside navigation.

composables/useFormSectionStatus.ts
useFormSectionStatus(): { statusText: (section: FormSectionStatus) => any; statusLabel: (section: FormSectionStatus) => string; sectionState: (section: FormSectionStatus) => FormStepState; stateStyle: (s…
ReturnsstatusTextstatusLabelsectionStatestateStylestateTextsectionProgresssectionItems

useEditPanel()

State of a create/edit BaseFormPanel: isOpen, editingId, values, create(), edit(id, values) and close().

composables/useEditPanel.ts
useEditPanel(blank: () => FormValues): { isOpen: any; editingId: any; values: any; create: (initial?: FormValues) => void; edit: (id: string, initial: FormValues) => void; close: () => void; }
ReturnsisOpeneditingIdvaluescreateeditclose

useInputStyles()

The look of every field: variant, density, radius, colour and the label class. Edit it to restyle all inputs.

composables/useInputStyles.ts
useInputStyles(): { inputLabelClass: string; inputStyle: Partial<Partial<{ style: import("vue").StyleValue; focused: boolean; errorMessages: string | readonly string[] | null; maxErrors: string | n…
ReturnsinputLabelClassinputStyleselectInputStyleselectionControlStylecheckboxListItemClass

useInputPlaceholder()

Default placeholders by input kind, such as [email protected] for emails.

composables/useInputPlaceholder.ts
useInputPlaceholder(kind?: InputPlaceholderKind): { resolvePlaceholder: (attrs: Record<string, unknown>) => any; resolveTextDefaults: (attrs: Record<string, unknown>) => { placeholder: string | undefined; autocomplete: string | u…
ReturnsresolvePlaceholderresolveTextDefaults

useInputValidity()

Mirrors the validity of a Vuetify field into aria-invalid.

composables/useInputValidity.ts
useInputValidity(): { fieldRef: any; ariaInvalid: any; }
ReturnsfieldRefariaInvalid

usePasswordStrength()

Scores a password from 0 to 4 with a label key and colour, for BasePasswordField show-strength.

composables/usePasswordStrength.ts
usePasswordStrength(password: MaybeRefOrGetter<string | null | undefined>): any
© 2026 melsami UI.
Developer documentation for melsami UI.