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 p
or.v-application ul
are no longer included. If you need margin forp
, or padding-left forul
andol
, set it manually in your root component's<style>
tag stateless
,clipped
,clipped-right
andapp
props 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.breakpoint
has been renamed to$vuetify.display
and extended with new properties
Theme
- Multiple themes are now supported, so
light
/dark
props have been removed from components. Usev-theme-provider
to set the theme for a specific component tree.- Components that previously had a
dark
prop, 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
/dark
to 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-1
is nowprimary-darken-1
.- To use variant namings as value for
color
props, 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.primary
is now.bg-primary
. - Text colors have a
text-
prefix, for example.primary--text
is now.text-primary
. - Variants are no longer a separate class, for example
.primary--text.text--darken-1
is now.text-primary-darken-1
.
- Backgrounds have a
- The theme system now uses CSS variables internally, so
customProperties
is no longer required.- If you were using
customProperties
in v2, the naming scheme has changed from--v-primary-base
to--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
colors
property, e.g.const myTheme = { theme: { themes: { light: { colors: { primary: '#ccc' } } } } }
SASS variables
$headings
was merged with$typography
: Access font-size of subtitle-2 withmap-get($typography, 'subtitle-2', 'size')
- If you imported variables from
~vuetify/src/styles/settings/_variables
in v2, you have to replace it withvuetify/settings
- Component variables that previously lived in e.g.
~/vuetify/src/components/VIcon/VIcon.sass
can now be imported fromvuetify/settings
directly too. $display-breakpoints
no longer includes{breakpoint}-only
variables (e.g. xs-only), use@media #{map-get(v.$display-breakpoints, 'xs')}
instead.- The
$transition
map has been removed, replaced with individual$standard-easing
,$decelerated-easing
,$accelerated-easing
variables. $container-padding-x
is now 16px instead of 12px as in v2. You can replace it with$spacer * 3
to 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}-only
has 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-4
is 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
value
prop has been replaced bymodel-value
on components that supportv-model
usage. (Vue 3 requires this change)- Note that this does not apply to
value
used as a selection value, for examplev-btn
withinv-btn-toggle
.
- Note that this does not apply to
@input
event has been replaced by@update:model-value
on components that supportv-model
usage. (Vue 3 requires this change)left
andright
have been replaced bystart
andend
respectively. This applies to utility classes too, for example.rounded-r
is now.rounded-e
.- Size props
small
/medium
/large
etc. have been combined into a singlesize
prop. absolute
andfixed
props have been combined into a singleposition
prop.top
/bottom
/left
/right
props have been combined into a singlelocation
prop.background-color
prop has been renamed tobg-color
.dense
prop on components such as v-select, v-btn-toggle, v-alert, v-text-field, v-list and v-list-item has been changed todensity
prop 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-switch
for example now uses an<input type="checkbox" />
under the hood, which is why thearia-checked
andaria-role="switch"
attributes were removed.
Input components
- Affix slots are consistent now:
prepend
andprepend-inner
are the same.append
has been renamed toappend-inner
.append-outer
has been renamed toappend
.
- Variant props
filled
/outlined
/solo
have been combined into a singlevariant
prop.- Allowed values are
'underlined'
,'outlined'
,'filled'
,'solo'
, or'plain'
.
- Allowed values are
success
andsuccess-messages
props have been removed.validate-on-blur
prop has been renamed tovalidate-on="blur"
.
v-alert
border
prop valuesleft
andright
have been renamed tostart
andend
.colored-border
prop has been renamed toborder-color
.dismissable
prop has been renamed toclosable
.outlined
andtext
props have been combined into a singlevariant
prop.- Allowed values are
'elevated'
,'flat'
,'tonal'
,'outlined'
,'text'
, or'plain'
.
- Allowed values are
text
prop has new purpose. It represents the text content of the alert, if default slot is not used.
v-badge
overlap
has been removed and is now the default style, usefloating
to restore the v2 default.- Transition props
mode
andorigin
have been removed. avatar
prop is no longer needed and has been removed.
v-banner
- The
actions
slot no longer provides a dismiss function. shaped
prop has been removed.icon-color
has been removed.single-line
has been replaced withlines="one"
.color
now applies to the icon and action text. Usebg-color
to change the background color.
v-btn/v-btn-toggle
active-class
prop has been renamed toselected-class
fab
is no longer supported. If you just need a round button, useicon
prop or apply a.rounded-circle
class.flat
/outlined
/text
/plain
props have been combined into a singlevariant
prop.depressed
has been renamed tovariant="flat"
retain-focus-on-click
has been removed, buttons use:focus-visible
instead.v-btn-toggle
needsmandatory="force"
prop to achieve the same behaviour asmandatory
prop in v2.- Disabled buttons use a faded variant of the specified
color
instead of grey (#15147)- The
$button-colored-disabled
sass variable can be set to false to use grey instead.
- The
v-checkbox/v-radio/v-switch
input-value
prop has been renamed tomodel-value
. (Vue 3 requires this change)on-icon
andoff-icon
props have been renamed totrue-icon
andfalse-icon
.on-value
andoff-value
props have been renamed totrue-value
andfalse-value
.v-checkbox
's label slot should no longer contain a<label>
as it is already wrapped with one
v-date-picker
- Uses
Date
objects 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-format
are now part of the date adapter and use the globally configured locale instead of being passed as props.active-picker
has been renamed toview-mode
.picker-date
has been replaced with separatemonth
andyear
props.range
is 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.valid
to determine form state.
v-list
two-line
andthree-line
props have been combined into a singlelines
prop with allowed values'two'
or'three'
.v-list-item-group
has been removed, just addvalue
to list items to make them selectable and bindv-model:selected
on v-list to get the selected value.v-list-item-icon
andv-list-item-avatar
have been removed, usev-list-item
withicon
oravatar
props, or put an icon or avatar in the append or prepend slot.v-list-item-content
has been removed, lists use CSS grid for layout now instead.v-list-group
can now be nested arbitrarily deep,sub-group
prop should be removed.v-list-item
input-value
prop has been replaced withactive
.v-list-item
inactive
prop has been replaced with:active="false" :link="false"
.v-subheader
has been renamed tov-list-subheader
.v-list-item
'sactive
scoped slot prop has been renamed toisActive
v-navigation-drawer
stateless
prop has been removed, manually control state usingmodel-value
orv-model
instead.
v-rating
color
has been renamed toactive-color
.background-color
has been renamed tocolor
.
v-select/v-combobox/v-autocomplete
- v-model values not present in
items
will now be rendered instead of being ignored. cache-items
prop has been removed, caching should be handled externally.item-text
has been renamed toitem-title
, and now looks up thetitle
property on item objects by default.value
is unchanged.item-disabled
has been removed, anddisabled
,header
,divider
, andavatar
properties are ignored on item objects.- Additional props to pass to
v-list-item
can be specified with theitem-props
prop.item-props
can be a function that takes the item object and returns an object of props, or set to booleantrue
to spread item objects directly as props.
- Additional props to pass to
- The
item
object in slots is now anListItem
object, the original item object is available asitem.raw
. - The
item
slot will no longer generate av-list-item
component automatically, instead aprops
object is supplied with the required event listeners and props:
html
<template #item="{ props }">
<v-list-item v-bind="props"></v-list-item>
</template>
- The
chip
slot should be used instead ofselection
if thechips
prop is set, this will provide some default values to the chips automatically. - Non-
multiple
combobox will now update its model as you type (like a text field) instead of only on blur.
v-simple-table
v-simple-table
has been renamed tov-table
v-stepper (vertical)
v-stepper-step
has been renamed tov-stepper-vertical-item
. Move content into the title slot.v-stepper-content
has been removed. Move content to the default slot ofv-stepper-vertical-item
.
v-data-table
- Headers objects:
text
property has been renamed totitle
.data-table-select
anddata-table-expand
must be defined askey
instead ofvalue
.class
has been replaced withheaderProps
.cellClass
has been replaced withcellProps
and now accepts either a function or an object.filter
function requiressearch
to be used in order for it to be triggered.
- Tables requires
search
prop to trigger filtering.items
array can be pre-filter with a computed. - Server side tables using
server-items-length
must 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-class
anditem-style
have been combined intorow-props
, andcell-props
has been added.sort-desc
andgroup-desc
have been combined intosort-by
andgroup-by
. These properties now take an array of{ key: string, order: 'asc' | 'desc' }
objects instead of strings.current-items
event has been renamed toupdate:current-items
.custom-sort
can now be done using the sort key in the headers object or by using thecustom-key-sort
prop.
v-slider/v-range-slider
ticks
has been renamed toshow-ticks
.tick-labels
has been renamed toticks
.vertical
has been renamed todirection="vertical"
.step
default value is now 0 instead of 1.
v-tabs
v-tab-item
has been removed, usev-window-item
v-img
contain
has been removed and is now the default behaviour. Usecover
to fill the entire container.
v-menu
rounded
prop has been removed. Apply a rounded css class to the menu content element instead. e.g..rounded-te
internal-activator
prop has been removed, use a ref or unique selector instead.absolute
,offset-y
andoffset-x
props have been removed. Manual positioning is now done by passing a[x, y]
array to thetarget
prop.nudge-*
props have been removed. There is no direct replacement butoffset
can be used to achieve similar results.
v-snackbar
action
slot was renamed toactions
v-expansion-panel
v-expansion-panel-header
has been renamed tov-expansion-panel-title
.v-expansion-panel-content
has been renamed tov-expansion-panel-text
.v-expansion-panel
now hastext
andtitle
props that can be used instead of subcomponents.
v-card
v-card
does not allow content to overflow or use higherz-index
values 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
value
is nowmodel-value
Directives
v-intersect
- Handler argument order has changed from
entries, observer, isIntersecting
toisIntersecting, entries, observer