# Alert

Alert component used mainly for displaying notifications.

# Usage

Examples
<template>
  <div>
    <CAlert color="primary">
      This is info alert.
    </CAlert>
    <CAlert color="warning" closeButton>
      This is warning dismissible alert.
    </CAlert>
    <CAlert
      color="danger"
      :show.sync="currentAlertCounter"
      closeButton
    >
      This alert will close after {{currentAlertCounter}} seconds.
      <CProgress
        :max="10"
        :value="currentAlertCounter"
        height="3px"
        color="danger"
        animate
      />
    </CAlert>
    <CButton
      color="primary"
      v-if="!currentAlertCounter"
      @click="currentAlertCounter = 10"
    >
      Show alert with timer
    </CButton>
  </div>
</template>

# Features

  • Temporary or constant visibility,
  • Optionally dismissible by user,
  • When visible temporary timer can be tracked and displayed (i.e. via Progress component),
  • Optional fading effect

# CAlert API

Name
Default
Type
color undefined String
Defines background color of the alert
closeButton false Boolean
Adds close button to the alert.
show true Boolean/Number
Prop is controlling visibility, there are following states:
  • true: default state, alert is rendered
  • false: alert is not rendered
  • Numeric value: Alert will be rendered passed value for time period equal to that number in seconds.
If you need to track state of alert set .sync modifier on this prop.
fade true Boolean
Sets fading effect on visibility change.