Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ToastNotificationComponent

Toast notifications are used to notify users of a system occurrence. Toast notifications should be transient and stay on the screen for 8 seconds, so that they do not block the information behind them for too long, but allows the user to read the message. The ToastNotification component allows status, header, message, primary action and menu actions for the notification. The notification can also allow the user to close the notification.

Note: Using the kebab menu (more actions) with the close button is not currently supported. If both are specified the close button will not be shown. Add a close menu item if you want to have both capabilities.

Usage:

// Individual module import
import { ToastNotificationModule } from 'patternfly-ng/notification';
// Or
import { ToastNotificationModule } from 'patternfly-ng';

// NGX Bootstrap import { BsDropdownConfig, BsDropdownModule } from 'ngx-bootstrap/dropdown';

@NgModule({ imports: [ToastNotificationModule, BsDropdownModule.forRoot(),...], providers: [BsDropdownConfig] }) export class AppModule(){}

Optional:

import { Notification, NotificationEvent, NotificationType } from 'patternfly-ng/notification';

Hierarchy

  • ToastNotificationComponent

Implements

  • DoCheck
  • OnInit

Index

Constructors

constructor

Properties

header

header: string

The notification header

message

message: string

The notification message

moreActions

moreActions: Action[]

The notification kebab actions

notification

notification: Notification

An object containing notifications properties

onActionSelect

onActionSelect: EventEmitter<Object> = new EventEmitter()

The event emitted when an action has been selected

onCloseSelect

onCloseSelect: EventEmitter<Object> = new EventEmitter()

The event emitted when the close button has been selected

onViewingChange

onViewingChange: EventEmitter<Object> = new EventEmitter()

The event emitted when the mouse hovers over and leaves a notification

primaryAction

primaryAction: Action

The primary action

showClose

showClose: boolean

Set to true to show close button

type

type: string

The notification type (e.g., NotificationType.SUCCESS, NotificationType.INFO, etc.)

Accessors

showCloseButton

  • get showCloseButton(): boolean

Methods

handleEnter

  • handleEnter($event: MouseEvent): void

handleLeave

  • handleLeave($event: MouseEvent): void

ngDoCheck

  • ngDoCheck(): void

ngOnInit

  • ngOnInit(): void

Generated using TypeDoc