CoreUI Angular Logo
Framework:
  • JavaScript / Vanilla JS
  • React.js
  • Vue.js
Getting startedIntroductionSupport CoreUICustomizeSassOptionsCSS VariablesLayoutBreakpointsContainersGridColumnsGuttersFormsOverviewDate PickerPRODate Range PickerPROForm ControlSelectMulti SelectPROChecks & RadiosPassword InputPRORangeRange SliderPRORatingPROStepperPROInput GroupFloating LabelsLayoutTime PickerPROValidationComponentsAccordionAlertAvatarBadgeBreadcrumbButtonButton GroupCalendarPROCalloutCardCarouselClose buttonCollapseDropdownFooterHeaderImageList GroupLoading ButtonPROModalNavNavbarOffcanvasPaginationPlaceholderPopoverProgressSmart PaginationPROSmart TablePROSidebarSpinnerTableTabsNewToastTooltipWidgetsIconsChartsTemplatesNewAdmin & DashboardDownloadInstallationCustomizeContentMigrationv4 → v5v3 → v4Angular version


DownloadHire UsGet CoreUI PRO
On this page

Angular Alert Component

Angular alert component gives contextual feedback information for common user operations. The alert component is delivered with a bunch of usable and adjustable alert messages.

Examples

Colors

Angular Alert is prepared for any length of text, as well as an optional close button. For a styling, use one of the required contextual color props (e.g., primary). For inline dismissal, use the dismissing prop.

A simple primary alert—check it out!A simple secondary alert—check it out!A simple success alert—check it out!A simple danger alert—check it out!A simple warning alert—check it out!A simple info alert—check it out!A simple light alert—check it out!A simple dark alert—check it out!
Loading...
Loading...

Link color

Use the cAlertLink directive class to quickly provide matching colored links within any alert.

A simple primary alert with an example link. Give it a click if you like. A simple secondary alert with an example link. Give it a click if you like. A simple success alert with an example link. Give it a click if you like. A simple danger alert with an example link. Give it a click if you like. A simple warning alert with an example link. Give it a click if you like. A simple info alert with an example link. Give it a click if you like. A simple light alert with an example link. Give it a click if you like. A simple dark alert with an example link. Give it a click if you like.
Loading...
Loading...

Additional content

Alert can also incorporate supplementary HTML elements like heading with cAlertHeading, paragraph, and divider.

Well done!

Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.


Whenever you need to, be sure to use margin utilities to keep things nice and tidy.

Loading...
Loading...

Dismissing

Alerts can also be easily dismissed. Just add the dismissible prop and fade for animation. To remove an alert from the DOM, you can use *ngIf directive.

Go right ahead and click that dismiss over there on the right.
Loading...
Loading...

Custom template

Use alertButtonCloseTemplate to customize close button.

Go right ahead and click that dismiss over there on the right.
Loading...
Loading...

Icons

You can use Icons and flexbox utilities to create alerts with icons.

An example alert with cIcon
An example alert with svg icon

An example primary alert with an icon
An example success alert with an icon
An example warning alert with an icon
An example danger alert with an icon
Loading...
Loading...

API reference

Alert Module

import { AlertModule } from '@coreui/angular';

@NgModule({ 
 imports: [AlertModule,]
})
export class AppModule(){}

c-alert

component

Inputs
name description type default
color Sets the color context of the component string 'primary'
dismissible adds a close button to alert for self dismiss boolean false
fade adds optional animation for dismissible alert boolean false
variant Set the alert variant to a solid string: 'solid' undefined
visible toggle visibility of alert component boolean true
Outputs
name description type
visibleChange Event triggered on the alert dismiss. boolean

cAlertHeading

directive

cAlertLink

directive

  • GitHub
  • Twitter
  • Support
  • CoreUI (Vanilla)
  • CoreUI for React.js
  • CoreUI for Vue.js

CoreUI for Angular is Open Source UI Components Library for Angular.

Currently v5.5.1 Code licensed MIT , docs CC BY 3.0 .
CoreUI PRO requires a commercial license.