Movatterモバイル変換


[0]ホーム

URL:


CoreUI Angular Logo
Framework:
Getting startedIntroductionSupport CoreUICustomizeSassOptionsCSS VariablesLayoutBreakpointsContainersGridColumnsGuttersFormsOverviewAutocompletePRODate 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 therequired contextualcolor props (e.g.,primary). For inline dismissal, use thedismissing 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 thecAlertLink directive class to quickly provide matching colored links within any alert.

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

Additional content

Alert can also incorporate supplementary HTML elements like heading withcAlertHeading, 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 thedismissible prop andfade 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

UsealertButtonCloseTemplate 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
namedescriptiontypedefault
colorSets the color context of the componentstring'primary'
dismissibleadds a close button to alert for self dismissbooleanfalse
fadeadds optional animation for dismissible alertbooleanfalse
variantSet the alert variant to a solidstring: 'solid'undefined
visibletoggle visibility of alert componentbooleantrue
Outputs
namedescriptiontype
visibleChangeEvent triggered on the alert dismiss.boolean

cAlertHeading

directive

cAlertLink

directive

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

Currently v5.5.17 Code licensed MIT, docs CC BY 3.0 .
CoreUI PRO requires acommercial license.


[8]ページ先頭

©2009-2025 Movatter.jp