Skip to content

NotificationCentre

Recent notifications in All and Unread tabs, announced politely, with a switch that pauses them.

  • Pro
  • Version 2.0.0-rc.1
  • APG pattern: Tabs + list + live region

Examples

Still previews of the real component, rendered from its stories. Pro code isn’t public, so nothing in them responds. Switch the theme and density for every preview at once.

Default

Notifications

Empty

Notifications

Nothing new.

Show the code

Empty, code

<NotificationCentre notifications={[]} />

Tokens

The 14 design tokens NotificationCentre reads, with the value each has in the theme and density chosen above. Change a token and the component follows, in Figma and in code.

Show all 14 tokens
Tokens NotificationCentre reads
TokenValue nowCSS variable
color.action.primary…--sd-color-action-primary
color.bg.canvas…--sd-color-bg-canvas
color.bg.subtle…--sd-color-bg-subtle
color.border.default…--sd-color-border-default
color.border.subtle…--sd-color-border-subtle
color.text.default…--sd-color-text-default
color.text.secondary…--sd-color-text-secondary
radius.full…--sd-radius-full
shape.radius-surface…--sd-shape-radius-surface
spacing.gap.sm…--sd-spacing-gap-sm
spacing.inset.lg…--sd-spacing-inset-lg
spacing.inset.md…--sd-spacing-inset-md
spacing.inset.sm…--sd-spacing-inset-sm
target.min…--sd-target-min

Install

Pro components come as source from the SuperDuper registry, with a licence key from Solo, Team or Studio. The registry and checkout aren’t open yet.

Add it from the registry (Pro licence key)

npx shadcn@latest add @superduperui/notification-centre

Then import it

import { NotificationCentre } from "@/components/ui/notification-centre"

Props

NotificationCentre props
PropTypeWhat it does
notificationsrequiredNotificationItem[]
titlestringDefault 'Notifications'Heading of the panel. Default "Notifications".
isPausedbooleanHold new notifications: nothing new is announced or shown until it is turned off (2.2.4).
onPausedChange(paused: boolean) => void
onMarkAllRead() => void
headingLevel2 | 3 | 4Default 2Heading level of the title (2.4.10). Default 2.
emptyTextstringDefault 'Nothing new.'Shown when a tab has nothing.
classNamestring

When to use it

Use it for

  • An in-app notifications panel or page

Use something else for

  • A one-off message about an action: use Toast
  • A page-level warning: use Alert

Accessibility

Screen readers announce "New notification: Invoice ready" (polite); "Pause notifications, switch, off".

WCAG 2.2 AAA criteria the component meets in Comfortable density: 1.4.6, 1.4.9, 2.1.3, 2.3.2, 2.4.13, 2.5.5, 2.5.6.

Compact density meets AA (2.5.8, 24px targets), not AAA.

What your product still has to do

  • Keep each notification short and say what happened

Shared patterns it ships with: 2.2.4 (Pause notifications holds new ones).

This release’s test results

Test results for NotificationCentre in this release
axe-core (WCAG A, AA, AAA and best practice)60 runs across every story, theme, density and width: 0 violations
Rendered text contrast425 text runs: 0 below 7:1, lowest 11.42:1
Target size82 targets: 0 under 44px in Comfortable
Focus appearance (2.4.13)126 focus stops in 3 browser engines: all pass
Keyboard scriptChromium 6 of 6, Firefox 6 of 6, WebKit 6 of 6

Manual passes with VoiceOver and NVDA haven’t been done yet.

Keyboard

Each step is scripted and run in Chromium, Firefox and WebKit.

NotificationCentre keyboard steps
KeyWhat happens
TabTab reaches the demo button
TabTab reaches Mark all as read
TabTab reaches the Pause switch
SpaceSpace pauses notifications
TabTab enters the tabs
ArrowRightRight shows Unread

In Figma

The Figma component is NotificationCentre, with Tab (All, Unread); State (Default, Empty). The Figma library isn’t published yet.

Figma to code: Tab (All, Unread; preview only); Paused → isPaused; Title → title; Show mark all read → onMarkAllRead; State (Default, Empty = notifications=[]); nested Item → notifications.