Components

BaseForm

A schema-driven form: describe sections and fields as data and it renders the inputs, validation, layout, steps and actions.

components/ui/form/BaseForm.vue
View in the demo

Page layout

Submit it empty to see the error summary. Turn on discounts to reveal the field that depends on it (visibleIf).

Text

Options

Plan

Stepper

layout="stepper" splits the sections into steps; contained puts steps, fields and actions in one card, as the onboarding example does.

Text


Tabs

Text

Layouts

Layout
Use it for
panelInside a BaseFormPanel drawer or dialog. The default.
pageA full page with the sections stacked.
asideA page with a section navigation and progress on the side (BaseFormNav).
tabsOne section per tab, with error counts (BaseFormTabs).
stepperOne section per step, with back and next (BaseFormSteps).

Fields

Every field has a key (its name in the values), a type and the options of that type. Common options are label, hint, info, placeholder, cols (out of 12), rules, clearable, disabled, readonly, visibleIf and props (extra props passed to the input).

Type
Renders
Own options
text, email, password, tel, urlBaseTextField / BasePasswordFieldprefix, suffix, counter, autocomplete, inputmode, showStrength
textareaBaseTextarearows, counter
number, currencyBaseNumberInputmin, max, step, precision, prefix, suffix
select, autocompleteBaseSelectInput / BaseAutocompleteitems, multiple, chips, loading
radio, checkbox, toggleBaseRadioGroup / BaseCheckboxGroup / BaseToggleGroupitems, inline, mandatory
switchBaseSwitchtext
date, dateRangeBaseDateInput / BaseDateRangeFieldmin, max
rangeBaseRangeSlidermin, max, step, prefix, suffix
fileBaseFileInputaccept, multiple
customYour componentcomponent

Rules

rules accepts names (required, accepted, email, phone, url, numeric, integer, positive, password), tuples (['min', 1], ['maxLength', 80], ['pattern', '^[a-z]+$'], ['match', 'password']) or any function (value, values) => true | string. Fields without required are marked optional automatically.

API

Props

Name
Type
Default
Description
fieldsFormField[]—The fields, when you do not need sections.
sectionsFormSection[]—The sections, each { key, title?, description?, icon?, fields, visibleIf? }.
layoutFormLayout"panel"panel, page, aside, tabs or stepper.
loadingboolean—Shows the submit button loading and blocks the form.
readonlyboolean—Shows the values without letting the user edit them.
disabledboolean—Disables every field and action.
submit-disabledboolean—Disables only the submit button, for example while a required name is still empty.
submit-labelstring—The text of the submit button.
cancel-labelstring—The text of the cancel button.
hide-actionsboolean—Hides the footer, for forms you submit from outside.
dirty-actionsboolean—Shows the footer only when there are unsaved changes, as a save bar. Call markClean() after saving.
hide-cancelboolean—Removes the cancel button.
show-create-anotherboolean—Adds a “Create another” checkbox that keeps the panel open after submitting.
hide-error-summaryboolean—Hides the summary of invalid fields.
confirm-leavebooleantrueAsks before closing or leaving with unsaved changes.
draft-keystring—Saves a draft in localStorage under this key and offers to restore it.
steps-orientationFormStepsOrientation"horizontal"horizontal or vertical steps in the stepper layout.
containedbooleanfalseWraps steps, fields and actions in a single card.
v-modelFormValues{}The values, keyed by field key.

Slots

Name
Slot props
Description
#actions{ loading: boolean; isDirty: any; submit: () => Promise<void>; cancel: () => void; reset: (next?: FormValues | undefined) => void; }Replaces the footer buttons; receives loading, isDirty, submit, cancel and reset.
#actions-start—Secondary or destructive actions on the left of the footer, such as Delete.

Events

Name
Payload
Description
@update:modelValue[value: FormValues]The values changed.
@submit[values: FormValues, context: { createAnother: boolean; }]The form is valid; receives the values and { createAnother }.
@cancel—The user pressed Cancel.

Set server errors through a template ref: formRef.value?.setErrors(resolveSubmitError(error).fieldErrors). The Forms guide has the full flow.

© 2026 melsami UI.
Developer documentation for melsami UI.