# Notifications

Notifications inform users about important updates, system events, or required actions.

## Design

## Choosing the right format

Selecting the right notification component depends on urgency, persistence, and disruption level.

![Notifications components](<../images/notification-components.png>)

**Transient notifications** disappear automatically and don’t require user action. Best for quick updates that confirm actions without interruption.

- Use [toast (autoclose)](<https://element.siemens.io/components/status-notifications/toast-notification/>) for brief, low-priority updates that confirm an action or system event (e.g., “Email sent”).

**Persistent notifications** remain visible until the user acknowledges or resolves them. Used for ongoing awareness or required action.

- Use notification icon in the [application header](<https://element.siemens.io/components/layout-navigation/application-header/>) to provide access to a notification panel or popover where users can view and manage updates.
- Use [toast (manual close)](<https://element.siemens.io/components/status-notifications/toast-notification/>) when an update needs attention but isn’t urgent, such as "Limited connectivity" or "Scheduled maintenance in 30 minutes"
- Use [inline notifications](<https://element.siemens.io/components/status-notifications/inline-notification/>) for messages tied to a specific location or system state, such as "Energy consumption exceeds expected levels"
- Use the [status bar](<https://element.siemens.io/components/status-notifications/status-bar/>) for constant visibility without disrupting the workflow.
- Use [modals](<https://element.siemens.io/components/layout-navigation/modals/>) for urgent decisions that require immediate attention and block further interaction.

### Handling multiple notifications

To prevent overwhelming users, limit the number of visible notifications. Consider:

- Set a maximum number of displayed notifications. Collapse older ones into a summary when exceeded.
- Use a summary message (e.g., “3 new notifications”) to redirect users to a notification management view.
- Determine the summary status based on severity, this could be the most recent or the highest-priority notification.

![Notifications overflow](<../images/notifications-overflow.png>)

## Notification management

Toasts, inline messages, and other notifications can appear throughout the interface, so a centralized view helps users review and manage them as needed.

The following examples show how to structure notifications, adapt based on the use case.

![Notifications management basic patterns](<../images/notification-management.png>)

### Notification popover

The popover is accessed through the application header, providing quick, non-intrusive access to recent notifications without disrupting the workflow. Users can select a [notification item](<https://element.siemens.io/components/status-notifications/notification-item/>) to be redirected to the relevant page, task, or item.

![Notifications popopver](<../images/notifications-popover.png>)

> 1. Global actions (optional), 2. Search (optional), 3. [Notification item](<https://element.siemens.io/components/status-notifications/notification-item/>), 4. Footer (optional)

The popover supports various actions. The footer and header are reserved for global actions. Additionally, it can include a search function for quick filtering.

![Notifications popopver variants](<../images/notifications-popover-variants.png>)

- Allow users to manage notification preferences through a settings link.
- If applicable, include a “Show all” option to access a full-page view for older notifications.

### Notification panel

Uses the [side panel](<https://element.siemens.io/components/layout-navigation/side-panel/>) for managing or browsing a larger number of notifications while maintaining the current workflow. It provides more space for detailed notifications and supports additional functionality, such as filtering, grouping, and actions on individual notifications. Just like in the popover, users can select a notification to be redirected to the relevant page, task, or item.

- If a side panel is already open, the notifications panel will replace it to ensure only one panel is active at a time.
- The panel should remain open when navigating between pages, allowing users to keep track of their notifications without interruption.

![Notifications in side panel](<../images/notifications-side-panel.png>)

> 1. Global actions (optional), 2. Search (optional), 3. [Notification item](<https://element.siemens.io/components/status-notifications/notification-item/>)

#### Action placement

- If there is only one action, place it on the same row as the text.
- If there are multiple actions, place them below the text.
- If there are +3 actions or actions that cannot be represented with a meaningful icon, group them in a menu.

Use icon-only actions for universally recognized meanings (e.g., trash for delete). If an icon isn't self-explanatory, display its label at least once to help users learn their meaning. If an action cannot be effectively represented with an icon, use text-based buttons.

![Notifications management basic patterns](<../images/notifications-side-panel-actions.png>)

#### Groups

Notifications can be grouped by relevance, time, or any category to improve clarity:

- Use [tabs](<https://element.siemens.io/components/layout-navigation/tabs/>) for broad, mutually exclusive categories, helping users focus on one at a time.
- Use [accordions](<https://element.siemens.io/components/layout-navigation/accordion/>) for nested grouping within a category, allowing users to scan multiple groups without switching contexts.
- Use summary chips to provide a quick, at-a-glance overview of grouped notifications (e.g., "3 unread").

![Notifications management basic patterns](<../images/notifications-side-panel-groups.png>)

If combining methods, consider use tabs for main categories, accordions for nested groups, and summary chips for quick overviews. If many categories are available, consider using filter methods.

### Notification center

A notification center is a dedicated full-page view where users can review, filter, and manage all past and current notifications in one place. It can work independently or alongside other notification patterns, such as popovers and side panels.

![Notifications center](<../images/notifications-notification-center.png>)

## Code

### Examples

#### Notification Popover

#### Example

Component:

```typescript
/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
import { Component, inject } from '@angular/core';
import { RouterLink } from '@angular/router';
import {
  SiApplicationHeaderComponent,
  SiHeaderAccountItemComponent,
  SiHeaderActionItemComponent,
  SiHeaderActionsDirective,
  SiHeaderBrandDirective,
  SiHeaderCollapsibleActionsComponent,
  SiHeaderLogoDirective,
  SiHeaderSelectionItemComponent
} from '@siemens/element-ng/application-header';
import {
  SiHeaderDropdownComponent,
  SiHeaderDropdownItemComponent,
  SiHeaderDropdownTriggerDirective
} from '@siemens/element-ng/header-dropdown';
import { SiStatusIconComponent } from '@siemens/element-ng/icon';
import {
  SiNotificationItemComponent,
  type NotificationItemLink
} from '@siemens/element-ng/notification-item';
import { LOG_EVENT } from '@siemens/live-preview';

@Component({
  selector: 'app-sample',
  imports: [
    SiApplicationHeaderComponent,
    SiHeaderActionItemComponent,
    SiHeaderLogoDirective,
    SiHeaderCollapsibleActionsComponent,
    RouterLink,
    SiHeaderDropdownComponent,
    SiHeaderDropdownTriggerDirective,
    SiHeaderDropdownItemComponent,
    SiHeaderAccountItemComponent,
    SiHeaderActionsDirective,
    SiHeaderBrandDirective,
    SiHeaderSelectionItemComponent,
    SiNotificationItemComponent,
    SiStatusIconComponent
  ],
  templateUrl: './si-notification-item-popover.html',
  styles: `
    /** .header-dropdown-overlay is only applied to the si-header-dropdown if it is shown in an overlay. So not in the mobile mode */
    .header-dropdown-overlay .notification-dropdown {
      max-width: 400px;
    }

    .notification-dropdown {
      max-height: 70vh;
    }
  `,
  host: { class: 'p-5' }
})
export class SampleComponent {
  logEvent = inject(LOG_EVENT);

  allTenants = ['Tenant 1', 'Tenant 2', 'Tenant 3'];
  activeTenant = 'Tenant 1';

  itemLink: NotificationItemLink = {
    type: 'link',
    href: 'https://www.siemens.com',
    target: '_blank'
  };
}
```

Template:

```html
<div class="has-navbar-fixed-top">
  <si-application-header>
    <si-header-brand>
      <a siHeaderLogo routerLink="/" class="d-none d-md-flex"></a>
      <span class="application-name">Application name</span>
    </si-header-brand>

    <si-header-actions>
      <button
        class="d-none d-sm-flex"
        type="button"
        si-header-selection-item
        [siHeaderDropdownTriggerFor]="tenants"
        >{{ activeTenant }}</button
      >
      <button
        type="button"
        icon="element-language"
        si-header-action-item
        [badge]="5"
        [siHeaderDropdownTriggerFor]="notifications"
      >
        Notifications
      </button>

      <si-header-collapsible-actions>
        <button
          class="d-sm-none"
          type="button"
          si-header-selection-item
          [siHeaderDropdownTriggerFor]="tenants"
          >{{ activeTenant }}</button
        >
        <button
          si-header-action-item
          type="button"
          icon="element-help"
          [siHeaderDropdownTriggerFor]="support"
          >Support</button
        >
      </si-header-collapsible-actions>

      <button
        si-header-account-item
        type="button"
        name="John Doe"
        [siHeaderDropdownTriggerFor]="account"
      >
      </button>
    </si-header-actions>
  </si-application-header>

  <ng-template #tenants>
    <si-header-dropdown>
      @for (tenant of allTenants; track tenant) {
        <button
          si-header-dropdown-item
          type="button"
          [checked]="tenant === activeTenant ? 'check' : undefined"
          (click)="activeTenant = tenant"
        >
          {{ tenant }}
        </button>
      }
    </si-header-dropdown>
  </ng-template>

  <ng-template #notifications>
    <si-header-dropdown>
      <div class="d-flex flex-column notification-dropdown">
        <div class="dropdown-header d-flex justify-content-between align-items-center px-6 py-4">
          <span class="si-h5">Notifications</span>
          <button type="button" class="btn btn-tertiary" (click)="logEvent('Dismiss all')"
            >Dismiss all</button
          >
        </div>
        <div class="flex-grow-1 flex-shrink-1" style="overflow-y: auto">
          <si-notification-item
            timeStamp="Just now"
            heading="Security Alert - Unusual login detected"
            description="A new login from Germany was detected on your account. If this wasn't you, please review your security settings immediately."
            [itemLink]="itemLink"
          >
            <si-status-icon status="danger" class="icon" />
          </si-notification-item>

          <si-notification-item
            timeStamp="One month ago"
            heading="System Maintenance - Scheduled downtime"
            description="Planned maintenance window completed successfully. All systems are now operational and performance has been improved."
            [itemLink]="itemLink"
          >
            <si-status-icon status="info" class="icon" />
          </si-notification-item>

          <si-notification-item
            timeStamp="24.02.2025 09:40"
            heading="Team Update - Sarah joined your project"
            description="Sarah Miller has been added to the Industrial IoT Analytics project and has access to all shared resources."
            [itemLink]="itemLink"
          >
            <si-status-icon status="info" class="icon" />
          </si-notification-item>

          <si-notification-item
            timeStamp="18.02.2025 13:20"
            heading="Report Ready - Monthly analytics available"
            description="Your February performance report is ready for download. Click to view insights and key metrics for this period."
            [itemLink]="itemLink"
          >
            <si-status-icon status="info" class="icon" />
          </si-notification-item>
        </div>
        <div class="dropdown-divider"></div>
        <a class="si-h5 px-6 pt-4 pb-2" href="#">Show all</a>
      </div>
    </si-header-dropdown>
  </ng-template>

  <ng-template #account>
    <si-header-dropdown>
      <div class="mx-5">
        <div class="si-h5">John Doe</div>
        <div>john.doe&#64;siemens.com</div>
        <div class="d-flex align-items-center text-secondary mt-2">
          Siemens AG
          <span class="badge bg-default">Admin</span>
        </div>
      </div>
      <div class="dropdown-divider"></div>
      <button
        si-header-dropdown-item
        icon="element-language"
        type="button"
        [siHeaderDropdownTriggerFor]="language"
      >
        Language
      </button>
      <button si-header-dropdown-item icon="element-user" type="button">Profile</button>
    </si-header-dropdown>
  </ng-template>

  <ng-template #language>
    <si-header-dropdown>
      <div class="dropdown-header">Selection has no effect!</div>
      <button si-header-dropdown-item type="button">German</button>
      <button si-header-dropdown-item type="button">English</button>
    </si-header-dropdown>
  </ng-template>

  <ng-template #support>
    <si-header-dropdown>
      <button si-header-dropdown-item type="button">Help</button>
      <button si-header-dropdown-item type="button">Contact</button>
    </si-header-dropdown>
  </ng-template>
</div>
```

#### Notification Panel

#### Example

Component:

```typescript
/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
import { Component, inject } from '@angular/core';
import { FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
import { RouterLink } from '@angular/router';
import {
  SiApplicationHeaderComponent,
  SiHeaderAccountItemComponent,
  SiHeaderActionItemComponent,
  SiHeaderActionsDirective,
  SiHeaderBrandDirective,
  SiHeaderCollapsibleActionsComponent,
  SiHeaderLogoDirective,
  SiHeaderSelectionItemComponent
} from '@siemens/element-ng/application-header';
import {
  SiHeaderDropdownComponent,
  SiHeaderDropdownItemComponent,
  SiHeaderDropdownTriggerDirective
} from '@siemens/element-ng/header-dropdown';
import type { MenuItemAction } from '@siemens/element-ng/menu';
import {
  SiNotificationItemComponent,
  type NotificationItemLink,
  type NotificationItemQuickAction,
  type NotificationItemRouterLink
} from '@siemens/element-ng/notification-item';
import { SiSearchBarComponent } from '@siemens/element-ng/search-bar';
import { SiSidePanelComponent, SiSidePanelContentComponent } from '@siemens/element-ng/side-panel';
import { SiSummaryChipComponent } from '@siemens/element-ng/summary-chip';
import { LOG_EVENT } from '@siemens/live-preview';

interface Notification {
  itemLink?: NotificationItemRouterLink | NotificationItemLink;
  timeStamp: string;
  heading: string;
  description: string;
  quickActions: NotificationItemQuickAction[];
  unread?: boolean;
}

@Component({
  selector: 'app-sample',
  imports: [
    SiApplicationHeaderComponent,
    SiHeaderActionItemComponent,
    SiHeaderLogoDirective,
    SiHeaderCollapsibleActionsComponent,
    RouterLink,
    FormsModule,
    ReactiveFormsModule,
    SiHeaderDropdownComponent,
    SiHeaderDropdownTriggerDirective,
    SiHeaderDropdownItemComponent,
    SiHeaderAccountItemComponent,
    SiHeaderActionsDirective,
    SiHeaderBrandDirective,
    SiHeaderSelectionItemComponent,
    SiSidePanelComponent,
    SiSidePanelContentComponent,
    SiNotificationItemComponent,
    SiSearchBarComponent,
    SiSummaryChipComponent
  ],
  templateUrl: './si-notification-item-side-panel.html',
  host: { class: 'p-5' }
})
export class SampleComponent {
  logEvent = inject(LOG_EVENT);

  allTenants = ['Tenant 1', 'Tenant 2', 'Tenant 3'];
  activeTenant = 'Tenant 1';

  protected readonly notificationFilters = new FormGroup({
    showAll: new FormControl(true, { nonNullable: true }),
    showUnread: new FormControl(true, { nonNullable: true }),
    showArchived: new FormControl(false, { nonNullable: true })
  });

  collapsed = true;

  toggleSidepanel(): void {
    this.collapsed = !this.collapsed;
  }

  sidePanelPrimaryAction: MenuItemAction[] = [
    {
      type: 'action',
      label: 'Mark all as read',
      icon: 'element-checkbox-checked',
      action: () => this.logEvent('Mark all as read')
    }
  ];

  itemLink: NotificationItemLink = {
    type: 'link',
    href: 'https://www.siemens.com',
    target: '_blank'
  };

  quickActions: NotificationItemQuickAction[] = [
    {
      type: 'action-icon-button',
      icon: 'element-checkbox-checked',
      ariaLabel: 'Read',
      action: () => this.logEvent('Read')
    },
    {
      type: 'action-icon-button',
      icon: 'element-archive',
      ariaLabel: 'Archive',
      action: () => this.logEvent('Archive')
    },
    {
      type: 'action-icon-button',
      icon: 'element-delete',
      ariaLabel: 'Delete',
      action: () => this.logEvent('Delete')
    }
  ];

  filteredNotifications: Notification[] = [];

  notificationsUnread: Notification[] = [
    {
      itemLink: this.itemLink,
      timeStamp: 'Just now',
      heading: 'System alert requires attention',
      description:
        'Production equipment has stopped unexpectedly. Technical team has been notified and is investigating the issue.',
      quickActions: this.quickActions,
      unread: true
    },
    {
      itemLink: this.itemLink,
      timeStamp: '2 minutes ago',
      heading: 'Team assignment completed',
      description:
        'Maintenance personnel have been dispatched to address the equipment issue. Estimated resolution time is 45 minutes.',
      quickActions: this.quickActions,
      unread: true
    },
    {
      itemLink: this.itemLink,
      timeStamp: 'Today at 11:45',
      heading: 'Budget approval requested',
      description:
        'Additional funds needed for equipment replacement. Please review the request and provide approval by end of business day.',
      quickActions: this.quickActions,
      unread: true
    },
    {
      itemLink: this.itemLink,
      timeStamp: 'Today at 09:30',
      heading: 'Access permissions updated',
      description:
        'Temporary access has been granted to external contractor for equipment maintenance. Access expires at 6:00 PM today.',
      quickActions: this.quickActions,
      unread: true
    }
  ];

  notificationAll: Notification[] = [
    {
      itemLink: this.itemLink,
      timeStamp: 'Two weeks ago',
      heading: 'Software update completed',
      description:
        'System sensors have been successfully upgraded to the latest firmware version. Enhanced monitoring capabilities are now available.',
      quickActions: this.quickActions
    },
    {
      itemLink: this.itemLink,
      timeStamp: 'One month ago',
      heading: 'Training session completed',
      description:
        'All team members have completed the required safety certification training. Certificates remain valid for one year.',
      quickActions: this.quickActions
    },
    {
      itemLink: this.itemLink,
      timeStamp: 'One month ago',
      heading: 'Monthly performance report available',
      description:
        'Latest analytics show improvement in operational efficiency. Detailed metrics and insights are available for review.',
      quickActions: this.quickActions
    },
    {
      itemLink: this.itemLink,
      timeStamp: 'One month ago',
      heading: 'Contractor evaluation completed',
      description:
        'Performance review has been completed for external service provider. Overall rating shows satisfactory work quality.',
      quickActions: this.quickActions
    },
    {
      itemLink: this.itemLink,
      timeStamp: 'Two months ago',
      heading: 'Annual budget approved',
      description:
        'Funding has been approved for equipment replacement and maintenance operations for the upcoming fiscal year.',
      quickActions: this.quickActions
    },
    {
      itemLink: this.itemLink,
      timeStamp: 'Two months ago',
      heading: 'Maintenance schedule finalized',
      description:
        'Quarterly maintenance plan has been completed. All equipment inspections are scheduled for the following week.',
      quickActions: this.quickActions
    },
    {
      itemLink: this.itemLink,
      timeStamp: 'Two months ago',
      heading: 'New team member onboarded',
      description:
        'A new supervisor has joined the maintenance team. Onboarding process is complete and start date is confirmed.',
      quickActions: this.quickActions
    },
    {
      itemLink: this.itemLink,
      timeStamp: 'Two months ago',
      heading: 'Security audit completed',
      description:
        'Annual security review has been completed successfully. All access controls and permissions have been verified and updated.',
      quickActions: this.quickActions
    }
  ];

  notificationsArchived: Notification[] = [
    {
      itemLink: this.itemLink,
      timeStamp: 'Two weeks ago',
      heading: 'Equipment calibration completed',
      description:
        'Previous sensor issues have been resolved. Equipment has been recalibrated and returned to full operational capacity.',
      quickActions: this.quickActions
    },
    {
      itemLink: this.itemLink,
      timeStamp: 'One month ago',
      heading: 'Equipment disposal completed',
      description:
        'Outdated machinery has been safely disposed of following environmental guidelines. Space is now available for new installations.',

      quickActions: this.quickActions
    }
  ];

  private updateFilteredNotifications(): void {
    const { showAll, showUnread, showArchived } = this.notificationFilters.value;

    const combined: Notification[] = [];

    if (showUnread) {
      combined.push(...this.notificationsUnread);
    }

    if (showAll) {
      combined.push(...this.notificationAll);
    }

    if (showArchived) {
      combined.push(...this.notificationsArchived);
    }

    // Optionally, filter duplicates if necessary
    this.filteredNotifications = Array.from(new Set(combined));
  }

  constructor() {
    this.updateFilteredNotifications(); // initial load

    this.notificationFilters.valueChanges.subscribe(() => {
      this.updateFilteredNotifications();
    });
  }
}
```

Template:

```html
<si-side-panel #sidePanel mode="scroll" [collapsed]="collapsed" (closed)="collapsed = true">
  <si-application-header>
    <si-header-brand>
      <a siHeaderLogo routerLink="/" class="d-none d-md-flex"></a>
      <span class="application-name">Application name</span>
    </si-header-brand>

    <si-header-actions>
      <button
        class="d-none d-sm-flex"
        type="button"
        si-header-selection-item
        [siHeaderDropdownTriggerFor]="tenants"
        >{{ activeTenant }}</button
      >
      <button
        type="button"
        icon="element-language"
        si-header-action-item
        [badge]="4"
        (click)="toggleSidepanel()"
      >
        Notifications
      </button>

      <si-header-collapsible-actions>
        <button
          class="d-sm-none"
          type="button"
          si-header-selection-item
          [siHeaderDropdownTriggerFor]="tenants"
          >{{ activeTenant }}</button
        >
        <button
          si-header-action-item
          type="button"
          icon="element-help"
          [siHeaderDropdownTriggerFor]="support"
          >Support</button
        >
      </si-header-collapsible-actions>

      <button
        si-header-account-item
        type="button"
        name="John Doe"
        [siHeaderDropdownTriggerFor]="account"
      >
      </button>
    </si-header-actions>
  </si-application-header>

  <ng-template #tenants>
    <si-header-dropdown>
      @for (tenant of allTenants; track tenant) {
        <button
          si-header-dropdown-item
          type="button"
          [checked]="tenant === activeTenant ? 'check' : undefined"
          (click)="activeTenant = tenant"
        >
          {{ tenant }}
        </button>
      }
    </si-header-dropdown>
  </ng-template>

  <ng-template #account>
    <si-header-dropdown>
      <div class="mx-5">
        <div class="si-h5">John Doe</div>
        <div>john.doe&#64;siemens.com</div>
        <div class="d-flex align-items-center text-secondary mt-2">
          Siemens AG
          <span class="badge bg-default">Admin</span>
        </div>
      </div>
      <div class="dropdown-divider"></div>
      <button
        si-header-dropdown-item
        icon="element-language"
        type="button"
        [siHeaderDropdownTriggerFor]="language"
      >
        Language
      </button>
      <button si-header-dropdown-item icon="element-user" type="button">Profile</button>
    </si-header-dropdown>
  </ng-template>

  <ng-template #language>
    <si-header-dropdown>
      <div class="dropdown-header">Selection has no effect!</div>
      <button si-header-dropdown-item type="button">German</button>
      <button si-header-dropdown-item type="button">English</button>
    </si-header-dropdown>
  </ng-template>

  <ng-template #support>
    <si-header-dropdown>
      <button si-header-dropdown-item type="button">Help</button>
      <button si-header-dropdown-item type="button">Contact</button>
    </si-header-dropdown>
  </ng-template>

  <si-side-panel-content heading="Notifications" [primaryActions]="sidePanelPrimaryAction">
    <div class="d-flex flex-column h-100">
      <div style="flex: 0 0 auto">
        <div class="px-6 py-4">
          <si-search-bar
            placeholder="Search..."
            showIcon
            colorVariant="base-0"
            [debounceTime]="400"
          />
        </div>
        <form class="px-6 py-4 d-flex flex-row gap-4" [formGroup]="notificationFilters">
          <si-summary-chip
            label="All"
            [value]="notificationAll.length.toString()"
            [selected]="notificationFilters.controls.showAll.value"
            (selectedChange)="notificationFilters.controls.showAll.setValue($event)"
          />
          <si-summary-chip
            label="Unread"
            [value]="notificationsUnread.length.toString()"
            [selected]="notificationFilters.controls.showUnread.value"
            (selectedChange)="notificationFilters.controls.showUnread.setValue($event)"
          />
          <si-summary-chip
            label="Archived"
            icon="element-archive"
            [value]="notificationsArchived.length.toString()"
            [selected]="notificationFilters.controls.showArchived.value"
            (selectedChange)="notificationFilters.controls.showArchived.setValue($event)"
          />
        </form>
      </div>
      <div style="overflow-y: auto">
        @for (notification of filteredNotifications; track notification) {
          <si-notification-item
            [itemLink]="notification.itemLink"
            [timeStamp]="notification.timeStamp"
            [heading]="notification.heading"
            [description]="notification.description"
            [quickActions]="notification.quickActions"
            [unread]="notification.unread"
          />
        }
      </div>
    </div>
  </si-side-panel-content>
</si-side-panel>
```
