Notification Center

A recipe: notifications behind a bell, or in a page section — a Popover, an Item for each, a Toggle Group to filter, the state in your signals. No component of its own.

Usage

Usage

import {  Component,  LOCALE_ID,  ViewEncapsulation,  computed,  inject,  signal,} from '@angular/core';import {  ScBadge,

How it is made

The notifications are a signal of yours — each with an id, a Temporal instant, read or not — and the rest is computed from it: the unread count on the bell (a Badge), what the filter shows. Marking read and dismissing are updates of that signal. Times are written in the locale: Intl.RelativeTimeFormat («5 minutes ago», «yesterday»), the days from the reader's calendar.

import {  ScPopoverProvider, ScPopoverTrigger, ScPopoverPortal, ScPopover, ScBadge,  ScToggleGroup, ScToggleGroupItem, ScItemGroup, ScItem, ScItemBody, ScItemTitle,  ScItemDescription, ScItemActions, ScEmpty,} from '@semantic-components/ui';
<div scPopoverProvider>  <button scButton scPopoverTrigger>bell, «2 unread», <span scBadge>2</span></button>  <ng-template scPopoverPortal>    <div scPopover>      <div scToggleGroup [(value)]="filter">All · Unread</div>      <div scItemGroup role="list">        @for (notice of visible(); track notice.id) {          <div scItem role="listitem">            <div scItemBody>…</div>            <div scItemActions>Mark read · Dismiss</div>          </div>        }      </div>    </div>  </ng-template></div>

Accessibility

  • The bell says the count in words («Notifications, 2 unread»); the Badge on it is hidden from screen readers.
  • The list is a list; an unread one says so in words, not only by its dot; each button is named for its notification («Dismiss “New comment”»).
  • The Popover's: focus moves in when it opens, and back to the bell when it closes.

Examples

By day

Activity

today

Grace joined the team

Weekly report ready

yesterday

Password changed

Nov 29, 2026

New sign-in from Lisbon

import {  Component,  LOCALE_ID,  ViewEncapsulation,  computed,  inject,  signal,} from '@angular/core';import {  ScButton,

RTL

الإشعارات (2)

تعليق جديد

اكتمل النشر

import { Dir } from '@angular/cdk/bidi';import {  Component,  LOCALE_ID,  ViewEncapsulation,  computed,  inject,  signal,} from '@angular/core';import {