Upgrade Guide
This page contains a detailed list of breaking changes and the steps required to upgrade your application to Vuetify 3.0
Many of the changes on this page can be applied automatically using eslint-plugin-vuetify
This page is incomplete. Please check back later for more information, or submit a PR if you notice something missing. If you have additional questions, reach out to us in Discord
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
Vue.use(Vuetify)
const vuetify = new Vuetify({ ... })
const app = new Vue({
vuetify,
...
})
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-loaderhas 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 are 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.
An complete list of class changes will not be provided, please use eslint-plugin-vuetifyto 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.border-r
is now.border-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-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-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-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:
<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-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-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
Directives
v-intersect
- Handler argument order has changed from
entries, observer, isIntersecting
toisIntersecting, entries, observer
Ready for more?
Continue your learning with related content selected by the Team or move between pages by using the navigation links below.
Edit this page onGitHub