Vue Alerts

Vue Bootstrap 5 Alerts component

Responsive Alerts built with the latest Bootstrap 5 and Vue 3. Alerts provide contextual feedback messages for typical user actions with a handful of responsible and flexible alert boxes.

Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.

Note: Read the API tab to find all available options and advanced customization

Basic examples

Click the buttons to launch the alerts.

Static examples

Additional Content


Using the Vue alert component, it’s possible to dismiss any alert inline. Here’s how:

  • Add a dismiss property, which adds close button and extra padding to the right of the alert which positions the close button.
  • Click on the close button to dismiss the alert.

You can see this in action with a live demo:


You can manually show alert using show() method on the alert component ref.


You can manually hide alert using hide() method on alert component ref.


You can set the position of every alert using the position property.

Select horizontal / vertical alignment

Current position: top-right


You can display an alert anywhere. Just put it in your target element and fill the data-mdb-container attribute with id or class of parent.


You can set offset of your alert using a offset property.


You can turn on stacking your alerts using the stacking property.

Stacking - Container

You can also stack alerts inside the container

Vue Alerts - API


          import {
          } from 'mdb-vue-ui-kit';


Name Type Default Description
tag String 'div' Defines tag of the MDBAlert element
position String 'top-right' Sets a position for the alert. Any combination of 'vertical-horizontal' position: 'top|bottom-left|center|right'
delay Number 5000 Sets the length of animation delay
autohide Boolean true Alerts will hide automatically or not
width String 'unset' Sets width of alert
stacking Boolean true Enables stacking alerts
offset String '10 Changes alert offset
container String '' Defines container selector
appendToBody Boolean false Appends element to the end of the body
color String null Allows to set the color of an alert - primary | secondary | secondary | danger | warning | info | light | dark
dismiss Boolean false Makes alert dismissible with close button
animation Boolean true Allows to turn on or off the showing and hiding alert animation
static Boolean false Makes alert static (open by default)
hidden Boolean false Makes static alert hidden
id String 'MDBAlert-generated id' Allows to add custom id to alert element
v-model String '' Returns current picked time


Name Description Example
show Manually shows an alert
hide Manually hides an alert alertRef.hide()

            <MDBTimepicker v-model="alert1" ref="alertRef" />
            <MDBBtn @click.stop="$" color="primary">Show</MDBBtn>


Name Description
show This event fires immediately when the show method is called or `v-model` is set to true
shown This event fires immediately when the Alert is shown
hide This event fires immediately when the hide method is called or `v-model` is set to false
hidden This event fires immediately when the Alert is hidden

            <MDBTimepicker v-model="picker1" @close="doSomething" />