Migration to v5
Track and review changes to the CoreUI for Vue.js components to help you migrate from v4 to v5.
On this page
CoreUI for Vue is the Vue.js version of CoreUI components library, so before read this migration guide, please check also CoreUI 4 to 5 migration guide.
Dependencies
- Breaking The
vuepeer dependency changed from^3.2.21to^3.5.0. Upgrade Vue to 3.5 or newer. @coreui/coreui-prois now a dependency of@coreui/vue-pro, not a peer dependency. Keep it in your ownpackage.jsonif you import the stylesheet from it.@popperjs/coreis now a dependency of@coreui/vue-pro. In v4 it was bundled into the build. You do not need to install it yourself.date-fnsis no longer bundled. v4 used it for theformatproperty of the date pickers. Install it yourself if you use it ininputDateFormat.- Breaking The build files moved. The ES build moved from
dist/index.es.jstodist/esm/index.js, the CommonJS build fromdist/index.jstodist/cjs/index.js, and the types fromdist/index.d.tstodist/esm/index.d.ts. Import from the package root,@coreui/vue-pro, instead of a build file.
Components
CAlertHeading
- Breaking Renamed
componentproperty toas.
CAvatar
- Deprecated
textColorvalues:muted,high-emphasis,medium-emphasis,disabled,high-emphasis-inverse,medium-emphasis-inverse,disabled-inverse. The property validator no longer accepts them, so Vue logs a warning in development. The classes still render. - New
textColorvalues:primary-emphasis,secondary-emphasis,success-emphasis,danger-emphasis,warning-emphasis,info-emphasis,light-emphasis,body,body-emphasis,body-secondary,body-tertiary,black,black-50,white,white-50.
CBadge
- Breaking Renamed
componentproperty toas. - Deprecated
textColorvalues:muted,high-emphasis,medium-emphasis,disabled,high-emphasis-inverse,medium-emphasis-inverse,disabled-inverse. The property validator no longer accepts them, so Vue logs a warning in development. The classes still render. - New
textColorvalues:primary-emphasis,secondary-emphasis,success-emphasis,danger-emphasis,warning-emphasis,info-emphasis,light-emphasis,body,body-emphasis,body-secondary,body-tertiary,black,black-50,white,white-50.
CButton
- Breaking Renamed
componentproperty toas.
CCalendar
- Breaking Renamed the
calendar-cell-hoverevent todate-hover. It still emits the hovered date, ornullwhen the pointer leaves.
CCard
- Deprecated
textColorvalues:muted,high-emphasis,medium-emphasis,disabled,high-emphasis-inverse,medium-emphasis-inverse,disabled-inverse. The property validator no longer accepts them, so Vue logs a warning in development. The classes still render. - New
textColorvalues:primary-emphasis,secondary-emphasis,success-emphasis,danger-emphasis,warning-emphasis,info-emphasis,light-emphasis,body,body-emphasis,body-secondary,body-tertiary,black,black-50,white,white-50.
CCardHeader
- Breaking Renamed
componentproperty toas.
CCardImage
- Breaking Renamed
componentproperty toas.
CCardSubtitle
- Breaking Renamed
componentproperty toas.
CCardText
- Breaking Renamed
componentproperty toas.
CCardTitle
- Breaking Renamed
componentproperty toas.
CCloseButton
- Deprecated property
white, usedarkinstead.
CDatePicker
- Breaking The
formatproperty no longer formats the date. UseinputDateFormatinstead. WithoutinputDateFormat, the date is formatted with thelocaleproperty.
// Previous markup
<CDatePicker format="MMMM-dd-yyyy"/>
// New markup
import { format } from 'date-fns'
//...
<CDatePicker :inputDateFormat="(date) => format(new Date(date), 'MMMM-dd-yyyy')" />formatstill makes the input read-only, as it did in v4. If you remove it and want to keep the input read-only, setinputReadOnly.- Pair a custom
inputDateFormatwithinputDateParse, so a typed date is read back with the same pattern. - The
date-changeevent still emits the date object and the formatted string. The formatted string now followsinputDateFormat, or thelocaleproperty, instead offormat.
CDateRangePicker
- Breaking The
formatproperty no longer formats the date. UseinputDateFormatinstead. WithoutinputDateFormat, the date is formatted with thelocaleproperty.
// Previous markup
<CDateRangePicker format="MMMM-dd-yyyy"/>
// New markup
import { format } from 'date-fns'
//...
<CDateRangePicker :inputDateFormat="(date) => format(new Date(date), 'MMMM-dd-yyyy')" />formatstill makes the inputs read-only, as it did in v4. If you remove it and want to keep the inputs read-only, setinputReadOnly.- Pair a custom
inputDateFormatwithinputDateParse, so a typed date is read back with the same pattern. - The
start-date-changeandend-date-changeevents still emit the date object and the formatted string. The formatted string now followsinputDateFormat, or thelocaleproperty, instead offormat. - Breaking Removed the
indicator,cleanerandseparatorslots. The icons come from the stylesheet. Theindicator,cleanerandseparatorproperties still show or hide them.
CDropdown
- The default
variantchanged frombtn-grouptodropdown. The wrapper gets the.dropdownclass instead of.btn-group. Setvariant="btn-group"to keep the v4 markup.
CDropdownHeader
- Breaking Renamed
componentproperty toas.
CDropdownItem
- Breaking Renamed
componentproperty toas.
CDropdownMenu
- Breaking Renamed
componentproperty toas.
CDropdownToggle
- Breaking Renamed
componentproperty toas. - Breaking Removed property
active. Addclass="active"if you need the style.
CFormFeedback
- Breaking Renamed
componentproperty toas.
CFormRange
- Breaking Renamed
stepsproperty tostep.
CFormText
- Breaking Renamed
componentproperty toas.
CHeaderBrand
- Breaking Renamed
componentproperty toas.
CHeaderNav
- Breaking Renamed
componentproperty toas.
CInputGroupText
- Breaking Renamed
componentproperty toas.
CLink
- Breaking Renamed
componentproperty toas.
CListGroup
- Breaking Renamed
componentproperty toas.
CListGroupItem
- Breaking Renamed
componentproperty toas.
CLoadingButton
- Breaking Renamed
componentproperty toas.
CModalTitle
- Breaking Renamed
componentproperty toas.
CMultiSelect
- Breaking Removed key
textin the options list, uselabelinstead.
CNav
- Breaking Renamed
componentproperty toas. - The
underlinevariant has been changed tounderline-border. Usevariant="underline-border"to keep the v4 look.underlineis now a different, simpler style.
CNavbar
- Breaking Renamed
componentproperty toas.
CNavbarBrand
- Breaking Renamed
componentproperty toas.
CNavbarNav
- Breaking Renamed
componentproperty toas.
CNavItem
- Breaking Removed property
component. In v4 it set the element of the inner link. In v5,assets the element of the wrapper,liby default. To change the link element, put aCNavLinkinside.
// Previous markup
<CNavItem component="button" href="#">Docs</CNavItem>
// New markup
<CNavItem>
<CNavLink as="button" href="#">Docs</CNavLink>
</CNavItem>CNavLink
- Breaking Renamed
componentproperty toas.
COffcanvasTitle
- Breaking Renamed
componentproperty toas.
CPaginationItem
- Breaking Renamed
componentproperty toas.
CPlaceholder
- Breaking Renamed
componentproperty toas.
CProgress
- New
CProgressStackedcomponent for stacked bars. Put oneCProgressper segment inside it. SeveralCProgressBarelements inside oneCProgressstill render.
// Previous markup
<CProgress>
<CProgressBar :value="15" />
<CProgressBar color="success" :value="30" />
</CProgress>
// New markup
<CProgressStacked>
<CProgress :value="15" />
<CProgress color="success" :value="30" />
</CProgressStacked>CSidebar
- Breaking Sidebar has a light color scheme by default, use
colorScheme="dark"to make it dark. - Without the
visibleproperty, the sidebar is now shown on desktop. In v4 it was hidden. Anoverlaidsidebar still starts hidden.
CSpinner
- Breaking Renamed
componentproperty toas.
CTimePicker
- Breaking Removed the
indicatorandcleanerslots. The icons come from the stylesheet. Theindicatorandcleanerproperties still show or hide them.
CToastClose
- Breaking Renamed
componentproperty toas. - Deprecated property
white, usedarkinstead.
CToastHeader
- Breaking Removed the
closeevent. Listen to thecloseevent of the parentCToastinstead.
// Previous markup
<CToast>
<CToastHeader closeButton @close="onClose">Title</CToastHeader>
</CToast>
// New markup
<CToast @close="onClose">
<CToastHeader closeButton>Title</CToastHeader>
</CToast>Directives
v-c-popover and v-c-tooltip
- Breaking
contentandheaderare inserted as text, not HTML. Markup in the value shows as literal tags. For HTML content, useCPopoverorCTooltipand thecontentslot (and thetitleslot ofCPopover).