Notification

Notification

Angular Bootstrap Push notifications to your visitors with a toast, a lightweight and easily customizable alert message.

Toasts are lightweight notifications designed to mimic the push notifications that have been popularized by mobile and desktop operating systems. They’re built with flexbox, so they’re easy to align and position.

Custom Notification Types

image info

html
<CDBNotification [show]=true [fade]=true [autohide]='2' title="Contrast" message="Hello, world! This is a primary message."
text="11 mins ago" ></CDBNotification>
<CDBNotification [show]=true [fade]=true iconClassName="text-primary" title="Contrast"
message="Hello, world! This is a primary message." text="11 mins ago" ></CDBNotification>
<CDBNotification [show]=true [fade]=true iconClassName="text-secondary" title="Contrast"
message="Hello, world! This is a primary message." text="11 mins ago" ></CDBNotification>

Notification with Hidden Message

image info

html
<CDBNotification [show]=true [fade]=true [hideMessages]=true [autohide]='5' title="Contrast"
message="Hello, world! This is a primary message." text="11 mins ago" ></CDBNotification>
<CDBNotification [show]=true [fade]=true [hideMessages]=true iconClassName="text-success" title="Contrast"
message="Hello, world! This is a primary message." text="11 mins ago" ></CDBNotification>
<CDBNotification [show]=true [fade]=true [hideMessages]=true iconClassName="text-warning" title="Contrast"
message="Hello, world! This is a primary message." text="11 mins ago" ></CDBNotification>

Change Color of Icon Box

Simply add the disabled boolean attribute to CDBNotification

image info

html
<CDBNotification [show]=true [fade]=true color="success" title="Contrast" message="Hello, world! This is a primary message."
text="11 mins ago" ></CDBNotification>
<CDBNotification [show]=true [fade]=true color="danger" title="Contrast" message="Hello, world! This is a primary message."
text="11 mins ago" ></CDBNotification>
<CDBNotification [show]=true [fade]=true color="secondary" title="Contrast" message="Hello, world! This is a primary message."
text="11 mins ago" ></CDBNotification>
<CDBNotification [show]=true [fade]=true color="primary" title="Contrast" message="Hello, world! This is a primary message."
text="11 mins ago" ></CDBNotification>

Notification with Icons

Simply add the disabled boolean attribute to CDBNotification

image info

html
<CDBNotification [show]=true [fade]=true title="Contrast" icon="award" message="Hello, world! This is a primary message."
text="11 mins ago" ></CDBNotification>
<CDBNotification [show]=true [fade]=true iconClassName="text-primary" title="Contrast" icon="bus"
message="Hello, world! This is a primary message." text="11 mins ago" ></CDBNotification>
<CDBNotification [show]=true [fade]=true iconClassName="text-danger" title="Contrast" icon="burn"
message="Hello, world! This is a primary message." text="11 mins ago" ></CDBNotification>
<CDBNotification [show]=true [fade]=true iconClassName="text-success" icon="car-crash" title="Contrast"
message="Hello, world! This is a primary message." text="11 mins ago" ></CDBNotification>

Positioning

Simply add the disabled boolean attribute to CDBNotification

image info

html
<CDBNotification [show]=true [fade]=true title="Contrast" message="Hello, world! This is a positioned notification."
text="11 mins ago" position="top-left" ></CDBNotification>
<CDBNotification [show]=true [fade]=true title="Contrast" message="Hello, world! This is a positioned notification."
text="11 mins ago" position="bottom-right" ></CDBNotification>

API

Here in this section you will find information about required modules and available inputs, outputs, methods and events of this component.

Contrast Notification Bootstrap Modules used

import {NotificationModule } from 'cdbangular';

API Reference: Contrast Notification Inputs

The table below shows the possible input of the Notification component.

NameTypeDefaultDescriptionExample
bodyClassNameStringAdds custom className to the body section of notification componentbodyClassName="p-5 font-weight-bold"
bodyColorStringSet color to the body section of notification componentbodyColor="black"
ClassStringAdds custom classes to the wrapperClass="stylish-color-dark"
closeClassNameStringtext-darkAdds custom classes to the Close buttoncloseClassName="blue-grey-text"
fadeBooleanfalseAdds a fade effect when you close the notificationfade=true
hideMessagesBooleanfalseHides messages in the componenthideMessages=true
autohideNumberSets time in ms when box hide. 0 = infinityautoHide=3000
iconStringsquareSets a custom iconicon="bell"
iconClassNameStringAdds custom classes to the IconiconClassName="green-text"
messageStringSets message of the notificationmessage="Hello there! This is a toast message"
positionStringOne of top-right, top-center, top-left, bottom-right, bottom-center, bottom-leftposition="top-right"
showBooleantrueShows your component. If you do not use this setting, your component will exist, but it will be hidden.show=false
textStringSets text of the notificationtext="11 minutes ago"
titleStringSet header text of the notificationtitle="Someone sent you an email"
titleClassNameStringAdds custom classes to the title texttitleClassName="elegant-color-dark-white-text"
titleColorStringSets the color of the titletitleColor="white"