Modules

Form examples

Checkout, onboarding, booking, survey and filters, plus a gallery and a schema-driven playground.

config/forms.config.ts
View in the demo

/forms/overview is a gallery driven by FORM_EXAMPLES: a type filter, featured cards with icon, description and capability chips, compact links to forms that live elsewhere and the schema-driven playground. Each example starts with BasePageHeader + FormsExampleChips. How forms work is in Forms.

Files

File
Role
pages/forms/overview.vueThe gallery and the playground (useFormPlayground).
pages/forms/checkout.vueExpress pay, numbered sections, card brand detection, a discount code and a sticky summary.
pages/forms/onboarding.vueBaseForm layout="stepper" contained.
pages/forms/booking.vueBaseDatePicker and slot buttons with role="radio".
pages/forms/survey.vueA follow-up question by score and a progress bar.
pages/forms/filters.vueActive filter chips over a BaseDataTable.
config/forms.config.tsThe gallery entries, types and capability icons.
mocks/forms.mock.tsDemo submissions that throw FormSubmitError for server errors.
components/pages/forms/FormsExampleChips, FormsCheckoutSummary, FormsExpressPay.

Configuration

FORM_EXAMPLES

The entries of the gallery.

config/forms.config.ts
const FORM_EXAMPLES: FormExample[]

FORM_EXAMPLE_TYPES

The types of the filter.

config/forms.config.ts
const FORM_EXAMPLE_TYPES: FormExampleType[]

FORM_CAPABILITY_ICONS

The icon of each capability chip.

config/forms.config.ts
const FORM_CAPABILITY_ICONS: Record<FormCapability, string>

Rules

Pure functions in utils/, unit tested in tests/unit/. Statuses and segments are derived from the stored data, never stored themselves.

cardBrand()

Card brand detection.

utils/form.ts
cardBrand(number: string): CardBrand | undefined

How it works

  • Every example is a plain v-form with Base* inputs, :rules from useFormRules() and useFormSubmit(values, handler).
  • Add an example by creating the page and adding an entry to FORM_EXAMPLES and to the menu in useNavigation().
© 2026 melsami UI.
Developer documentation for melsami UI.