Upgrade Guide
This page contains a detailed list of breaking changes and the steps required to upgrade your application to Vuetify 3.0
DANGER
Many of the changes on this page can be applied automatically using eslint-plugin-vuetify
INFO
Before upgrading, make sure to consult the Official Vue 3 Migration Guide
WARNING
Not all Vuetify 2 components are currently available in Vuetify 3; These components will be released as their development is completed via Vuetify Labs.
Setup
- Vuetify class removed, use createVuetify function
js
Vue.use(Vuetify)
const vuetify = new Vuetify({ ... })
const app = new Vue({
vuetify,
...
})js
const app = createApp()
const vuetify = createVuetify({ ... })
app.use(vuetify)import ... from 'vuetify'is now a-la-carte, import'vuetify/dist/vuetify.js'instead to get the complete bundle (not recommended).'vuetify/lib'should no longer be used, change to'vuetify'/'vuetify/components'/'vuetify/directives'as appropriate.- Only component styles are included, global styles must be imported separately from
'vuetify/styles'. - vuetify-loader has been renamed to webpack-plugin-vuetify, and we also have a new plugin for vite vite-plugin-vuetify.
Features
Layout
- Global styles previously included as
.v-application por.v-application ulare no longer included. If you need margin forp, or padding-left forulandol, set it manually in your root component's<style>tag stateless,clipped,clipped-rightandappprops have been removed from v-navigation-drawer, v-app-bar and v-system-bar. The position in the markup determines the appearance. Use theorder="number"prop to influence it manually.$vuetify.breakpointhas been renamed to$vuetify.displayand extended with new properties
Theme
- Multiple themes are now supported, so
light/darkprops have been removed from components. Usev-theme-providerto set the theme for a specific component tree.- Components that previously had a
darkprop, such as v-app-bar, now accepttheme="dark"prop
- Components that previously had a
- Theme colors set their foreground text color automatically, if you were using
light/darkto get a different text color you probably don't need it anymore. - The variant naming scheme has changed slightly, it is now a single word instead of two. For example,
primary darken-1is nowprimary-darken-1.- To use variant namings as value for
colorprops, the variant you intend to use needs to be enabled in the theme undertheme.variations.colors. e.g:colors: ['primary']
- To use variant namings as value for
- Color classes have been renamed:
- Backgrounds have a
bg-prefix, for example.primaryis now.bg-primary. - Text colors have a
text-prefix, for example.primary--textis now.text-primary. - Variants are no longer a separate class, for example
.primary--text.text--darken-1is now.text-primary-darken-1.
- Backgrounds have a
- The theme system now uses CSS variables internally, so
customPropertiesis no longer required.- If you were using
customPropertiesin v2, the naming scheme has changed from--v-primary-baseto--v-theme-primary. - Custom properties are now also an rgb list instead of hex so
rgb()orrgba()must be used to access them, for examplecolor: rgb(var(--v-theme-primary))instead ofcolor: var(--v-primary-base).
- If you were using
- Theme colors in the theme config are now nested inside a
colorsproperty, e.g.const myTheme = { theme: { themes: { light: { colors: { primary: '#ccc' } } } } }
SASS variables
$headingswas merged with$typography: Access font-size of subtitle-2 withmap-get($typography, 'subtitle-2', 'size')- If you imported variables from
~vuetify/src/styles/settings/_variablesin v2, you have to replace it withvuetify/settings - Component variables that previously lived in e.g.
~/vuetify/src/components/VIcon/VIcon.sasscan now be imported fromvuetify/settingsdirectly too. $display-breakpointsno longer includes{breakpoint}-onlyvariables (e.g. xs-only), use@media #{map-get(v.$display-breakpoints, 'xs')}instead.- The
$transitionmap has been removed, replaced with individual$standard-easing,$decelerated-easing,$accelerated-easingvariables. $container-padding-xis now 16px instead of 12px as in v2. You can replace it with$spacer * 3to get to the previous look.- Too many component variables to list have been renamed or removed. There is no automated way to update these as the element structure has changed significantly, you will need to manually update these along with any custom styles.
Styles and utility classes
.hidden-{breakpoint}-onlyhas been renamed to.hidden-{breakpoint}.text-xs-{alignment}has been renamed to.text-{alignment}to reflect the fact that it applies to all breakpoints.- Typography classes have been renamed for consistency and are all prefixed with
text-, for example.display-4is now.text-h1 - Transition easing classes have been removed.
INFO
An complete list of class changes will not be provided, please use eslint-plugin-vuetify to automatically fix them.
Components
General changes
valueprop has been replaced bymodel-valueon components that supportv-modelusage. (Vue 3 requires this change)- Note that this does not apply to
valueused as a selection value, for examplev-btnwithinv-btn-toggle.
- Note that this does not apply to
@inputevent has been replaced by@update:model-valueon components that supportv-modelusage. (Vue 3 requires this change)leftandrighthave been replaced bystartandendrespectively. This applies to utility classes too, for example.rounded-ris now.rounded-e.- Size props
small/medium/largeetc. have been combined into a singlesizeprop. absoluteandfixedprops have been combined into a singlepositionprop.top/bottom/left/rightprops have been combined into a singlelocationprop.background-colorprop has been renamed tobg-color.denseprop on components such as v-select, v-btn-toggle, v-alert, v-text-field, v-list and v-list-item has been changed todensityprop with the variantsdefault,comfortable,compact- Activator slots work slightly different. Replace
#activator={ attrs, on }with#activator={ props }, then removev-on="on"and replacev-bind="attrs"withv-bind="props" - Some components have structural changes in their markup. Which means you may have to change how you query and assert them in tests.
v-switchfor example now uses an<input type="checkbox" />under the hood, which is why thearia-checkedandaria-role="switch"attributes were removed.
Input components
- Affix slots are consistent now:
prependandprepend-innerare the same.appendhas been renamed toappend-inner.append-outerhas been renamed toappend.
- Variant props
filled/outlined/solohave been combined into a singlevariantprop.- Allowed values are
'underlined','outlined','filled','solo', or'plain'.
- Allowed values are
successandsuccess-messagesprops have been removed.validate-on-blurprop has been renamed tovalidate-on="blur".
v-alert
borderprop valuesleftandrighthave been renamed tostartandend.colored-borderprop has been renamed toborder-color.dismissableprop has been renamed toclosable.outlinedandtextprops have been combined into a singlevariantprop.- Allowed values are
'elevated','flat','tonal','outlined','text', or'plain'.
- Allowed values are
textprop has new purpose. It represents the text content of the alert, if default slot is not used.
v-badge
overlaphas been removed and is now the default style, usefloatingto restore the v2 default.- Transition props
modeandoriginhave been removed. avatarprop is no longer needed and has been removed.
v-banner
- The
actionsslot no longer provides a dismiss function. shapedprop has been removed.icon-colorhas been removed.single-linehas been replaced withlines="one".colornow applies to the icon and action text. Usebg-colorto change the background color.
v-btn/v-btn-toggle
active-classprop has been renamed toselected-classfabis no longer supported. If you just need a round button, useiconprop or apply a.rounded-circleclass.flat/outlined/text/plainprops have been combined into a singlevariantprop.depressedhas been renamed tovariant="flat"retain-focus-on-clickhas been removed, buttons use:focus-visibleinstead.v-btn-toggleneedsmandatory="force"prop to achieve the same behaviour asmandatoryprop in v2.- Disabled buttons use a faded variant of the specified
colorinstead of grey (#15147)- The
$button-colored-disabledsass variable can be set to false to use grey instead.
- The
v-checkbox/v-radio/v-switch
input-valueprop has been renamed tomodel-value. (Vue 3 requires this change)on-iconandoff-iconprops have been renamed totrue-iconandfalse-icon.on-valueandoff-valueprops have been renamed totrue-valueandfalse-value.v-checkbox's label slot should no longer contain a<label>as it is already wrapped with one
v-date-picker
- Uses
Dateobjects instead of strings. Some utility functions are included to help convert between the two, see dates. locale,locale-first-day-of-year,first-day-of-week,day-format,weekday-format,month-format,year-format,header-date-format, andtitle-date-formatare now part of the date adapter and use the globally configured locale instead of being passed as props.active-pickerhas been renamed toview-mode.picker-datehas been replaced with separatemonthandyearprops.rangeis not currently implemented, will be added as a separate component in the future.
v-form
validate()now returns aPromise<FormValidationResult>instead of a boolean. Await the promise then checkresult.validto determine form state.
v-list
two-lineandthree-lineprops have been combined into a singlelinesprop with allowed values'two'or'three'.v-list-item-grouphas been removed, just addvalueto list items to make them selectable and bindv-model:selectedon v-list to get the selected value.v-list-item-iconandv-list-item-avatarhave been removed, usev-list-itemwithiconoravatarprops, or put an icon or avatar in the append or prepend slot.v-list-item-contenthas been removed, lists use CSS grid for layout now instead.v-list-groupcan now be nested arbitrarily deep,sub-groupprop should be removed.v-list-iteminput-valueprop has been replaced withactive.v-list-iteminactiveprop has been replaced with:active="false" :link="false".v-subheaderhas been renamed tov-list-subheader.v-list-item'sactivescoped slot prop has been renamed toisActive
v-navigation-drawer
statelessprop has been removed, manually control state usingmodel-valueorv-modelinstead.
v-rating
colorhas been renamed toactive-color.background-colorhas been renamed tocolor.
v-select/v-combobox/v-autocomplete
- v-model values not present in
itemswill now be rendered instead of being ignored. cache-itemsprop has been removed, caching should be handled externally.item-texthas been renamed toitem-title, and now looks up thetitleproperty on item objects by default.valueis unchanged.item-disabledhas been removed, anddisabled,header,divider, andavatarproperties are ignored on item objects.- Additional props to pass to
v-list-itemcan be specified with theitem-propsprop.item-propscan be a function that takes the item object and returns an object of props, or set to booleantrueto spread item objects directly as props.
- Additional props to pass to
- The
itemobject in slots is now anListItemobject, the original item object is available asitem.raw. - The
itemslot will no longer generate av-list-itemcomponent automatically, instead apropsobject is supplied with the required event listeners and props:
html
<template #item="{ props }">
<v-list-item v-bind="props"></v-list-item>
</template>- The
chipslot should be used instead ofselectionif thechipsprop is set, this will provide some default values to the chips automatically. - Non-
multiplecombobox will now update its model as you type (like a text field) instead of only on blur.
v-simple-table
v-simple-tablehas been renamed tov-table
v-stepper (vertical)
v-stepper-stephas been renamed tov-stepper-vertical-item. Move content into the title slot.v-stepper-contenthas been removed. Move content to the default slot ofv-stepper-vertical-item.
v-data-table
- Headers objects:
textproperty has been renamed totitle.data-table-selectanddata-table-expandmust be defined askeyinstead ofvalue.classhas been replaced withheaderProps.cellClasshas been replaced withcellPropsand now accepts either a function or an object.filterfunction requiressearchto be used in order for it to be triggered.
- Tables requires
searchprop to trigger filtering.itemsarray can be pre-filter with a computed. - Server side tables using
server-items-lengthmust be replaced with<v-data-table-server items-length />. - Argument order for
@click:*events is now consistently(event, data).onRowClick (item, data, event)should be changed toonRowClick (event, { item }).
item-classanditem-stylehave been combined intorow-props, andcell-propshas been added.sort-descandgroup-deschave been combined intosort-byandgroup-by. These properties now take an array of{ key: string, order: 'asc' | 'desc' }objects instead of strings.current-itemsevent has been renamed toupdate:current-items.custom-sortcan now be done using the sort key in the headers object or by using thecustom-key-sortprop.
v-slider/v-range-slider
tickshas been renamed toshow-ticks.tick-labelshas been renamed toticks.verticalhas been renamed todirection="vertical".stepdefault value is now 0 instead of 1.
v-tabs
v-tab-itemhas been removed, usev-window-item
v-img
containhas been removed and is now the default behaviour. Usecoverto fill the entire container.
v-menu
roundedprop has been removed. Apply a rounded css class to the menu content element instead. e.g..rounded-teinternal-activatorprop has been removed, use a ref or unique selector instead.absolute,offset-yandoffset-xprops have been removed. Manual positioning is now done by passing a[x, y]array to thetargetprop.nudge-*props have been removed. There is no direct replacement butoffsetcan be used to achieve similar results.
v-snackbar
actionslot was renamed toactions
v-expansion-panel
v-expansion-panel-headerhas been renamed tov-expansion-panel-title.v-expansion-panel-contenthas been renamed tov-expansion-panel-text.v-expansion-panelnow hastextandtitleprops that can be used instead of subcomponents.
v-card
v-carddoes not allow content to overflow or use higherz-indexvalues to display on top of elements outside it. To disable this behavior, use<v-card style="overflow: initial; z-index: initial">(#17593, #17628)
v-sparkline
valueis nowmodel-value
Directives
v-intersect
- Handler argument order has changed from
entries, observer, isIntersectingtoisIntersecting, entries, observer