Migrate to v2

Breaking changes to handle when upgrading from v1 to v2.
View source

Overview

v2 refocuses on schema-driven admin features (AutoForm, SearchForm, DataTable and API) and removes components that overlap with Nuxt UI or offer little reuse value. This guide covers the behavior changes and replacements to check during the upgrade.

Upgrade Steps

  1. Check runtime requirements. Verify the supported versions, then update dependencies and the lockfile. See Runtime and API.
  2. Replace removed features. Check the component and type replacements and AutoForm controls.
  3. Review behavior changes. Check Forms, Table and Locale and the API migration table.
  4. Verify the migration. Run the project's lint, type checks, tests and build, then check the workflows your project uses.

Migrate with AI

Open your coding assistant in the project root, then expand and copy the prompt or ask the assistant to read the Markdown version of this page. The prompt uses v1.8.3 as its baseline and asks the assistant to check for earlier v1 changes when they apply.

Removed Components

ComponentReplacement
MWithClearCompose UInput, see the Nuxt UI Input example
MWithCopyCompose UInput, see the Nuxt UI Input example
MWithPasswordToggleCompose UInput, see the Nuxt UI Input example
MWithCharacterLimitCompose UInput, see the Nuxt UI Input example
MWithFloatingLabelCompose UInput, see the Nuxt UI Input example
MAsPhoneNumberInputCompose UInput, see the Nuxt UI Input example
MPillGroupChoose URadioGroup / UCheckboxGroup with variant="card", UToggleGroup or UTabs according to the interaction
MColorChooserUColorPicker inside a UPopover
MSlideVerifyNo built-in replacement; implement your own or use a third-party human verification service
MPopconfirmConfirm buttons inside a UPopover, or the imperative useMessageBox

The maska and colortranslator dependencies are removed as well, along with the Props / Emits / Slots type exports of these components (such as WithClearProps, PillGroupProps and ColorChooserProps).

Removed AutoForm Control Types

The following type values are no longer built in. Using them renders a [AutoForm] No control mapped notice:

  • withClear, withPasswordToggle, withCopy, withCharacterLimit, withFloatingLabel, asPhoneNumberInput
  • colorChooser, slideVerify, pillGroup

For simple cases, configure existing controls through controlProps. To retain an enhanced input, wrap it in a project component, register it with defineControl and pass controls to the form. A custom control can keep its original type name.

const schema = afz.object({
  // Before: afz.string({ type: 'withPasswordToggle' })
  password: afz.string({ controlProps: { type: 'password' } }),
  // Before: afz.enum([...], { type: 'pillGroup' })
  category: afz.enum(['All', 'Frontend', 'Backend'], {
    type: 'radioGroup',
    controlProps: { orientation: 'horizontal' }
  })
})

See Controls for details.

Runtime and API

DependencyRequired version
Node.js^22.22.3 || ^24.15.0 || >=26.0.0
Nuxt (Nuxt mode)^4.6.4
Nuxt UI4.13.0 or a later compatible v4 version
Zod4.3.6 or a later compatible v4 version
See the API migration table for changes to request options, error handling, hooks and transfer timeouts in Nuxt mode.

For a standalone Vue project, check the Vue / Vite setup.

Forms, Table and Locale

  • AutoForm binding. Bind input state with v-model and type it with z.input. The old :state still works and emits a development deprecation warning.
  • Reset and clear. reset() restores the baseline plus schema defaults. clear() keeps only schema defaults. Both update the bound object in place and emit a snapshot. Call setBaseline() after loading a record to make it the reset target.
  • SearchForm. Bind expansion with v-model:expanded. Submit payloads trim strings and drop empty values by default. Set :transform-payload="false" to keep the original payload.
  • DataTable. Action confirmations use confirmLabel, cancelLabel, confirmButton and cancelButton. Pagination uses complete templates with the keys empty, total, range, rangeUnknown, selected and pageSize.
  • Locale. Component text and useDateFormatter follow the UApp locale with an English fallback. Set the UApp locale or pass a formatter locale when needed.
  • DatePicker. v-model:open takes precedence over popoverProps.open. popoverProps.defaultOpen initializes uncontrolled state. Migrate existing controlled state to v-model:open before calling open() or close().

Documentation Paths

The docs are reorganized by capability. Old links redirect automatically:

  • /docs/composables/* is split into the matching sections: useAutoForm → Forms, useTheme → Theme, useMessageBox / useDateFormatter → their component pages, upload/download and streaming → API
  • The AutoForm field type pages are merged into Field Types, and SearchForm moves into the Forms section
  • The three AI integration pages are merged into AI Integration
Copyright © 2025 - 2026 YiXuan - MIT License