Skip to content
GitHub (opens in a new tab)

NotificationStack

The in-app inbox of product notifications, behind a bell with the unread count.

stableOrganismcontracts/notificationstack.json

Preview

NotificationStack

The durable in-app inbox: a bell with the unread count and a 24rem popover list. Below 40rem it opens as a full-height Drawer with the same rows.

Master

Open the bell, open an item to mark it read, or Mark all read (announced politely). Unread is a filled rail marker plus a New badge, never colour or weight alone. The count chip goes away at zero.

Notifications

3 unread

Today

Yesterday

Usage

Use NotificationStack for payments, sign-ins and billing updates people read later. It is built on the kit Popover; inline renders the same panel on a page. Toasts stay for instant feedback, and agent approvals live in AgentInbox.

Do's

  • show payments, sign-ins and billing updates people can read later
  • an app header needs a bell with an unread count
  • a settings or activity page shows the same list in place (inline)

Don'ts

  • instant feedback for an action just taken — Toast
  • agent approvals and questions — AgentInbox
  • a page-level message — Alert
<NotificationStack
  items={notifications}
  onItemClick={open}
  onMarkRead={markRead}
  onMarkAll={markAll}
  onViewAll={viewAll}
/>

The durable in-app inbox of product notifications: an sm bell with the unread count opens a 24rem kit Popover (a full-height Drawer below --grid-breakpoint-sm) with the list, Mark all read and View all. Toasts stay for instant feedback; agent approvals live in AgentInbox.

When to use

  • show payments, sign-ins and billing updates people can read later
  • an app header needs a bell with an unread count
  • a settings or activity page shows the same list in place (inline)

When not to use

  • instant feedback for an action just taken — Toast
  • agent approvals and questions — AgentInbox
  • a page-level message — Alert

What an agent reads

import { NotificationStack } from "agentic-ds-kit";
must
  • the bell is an sm kit IconButton named "Notifications, 3 unread"; the count chip is aria-hidden
  • the panel is the kit Popover dialog, named by label; Escape closes and returns focus to the bell. Below --grid-breakpoint-sm it is a kit Drawer with the same rows
  • unread is a filled rail marker plus a New badge, never colour or weight alone; each row reads "New. Payment failed. … 09:42." and the marker is aria-hidden
  • Mark all read is announced in a polite status region and focus stays on it
  • no count chip at zero
  • new items fade and drop in on transform and opacity, off under prefers-reduced-motion
  • Items that arrive while the panel is open open their height (the shared arrival glide), so rows below glide down, then rise in from a light blur; the first render stays still. No motion under prefers-reduced-motion
defaults
  • label Notifications
  • defaultOpen false
  • inline false
  • emptyTitle You’re all caught up
  • loading false
stops if
  • Do not invent a local NotificationBell or NotificationList
  • Do not restyle Toast as an inbox
  • Do not show unread by colour or bold alone: keep the marker and the New badge
  • Do not style Mark all read or View all as text links: they are ghost and outline sm Buttons
  • Do not route agent approvals here — AgentInbox
  • Do not use raw hex

From contracts/notificationstack.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
itemsarrayYes—{ id, title, body?, createdAt, read, tone?: 'neutral'|'success'|'info'|'warning'|'danger', icon?, group?, action?: { label, onClick } }[]. group ("Today", "Yesterday") gathers items under a heading; action is one outline sm Button, only when the event needs a decision. createdAt shows in mono.
labelstringNoNotifications—
openbooleanNo——
defaultOpenbooleanNofalse—
onOpenChangefunctionNo——
inlinebooleanNofalseRender the panel in place, with no bell or popover.
onItemClickfunctionNo——
onMarkReadfunctionNo—Called when an unread item is opened.
onMarkAllfunctionNo——
onViewAllfunctionNo——
emptyTitlestringNoYou’re all caught up—
emptyDescriptionstringNo——
loadingbooleanNofalse—
errorstringNo——
onRetryfunctionNo——
  • Component
    →

    Toast

    A short note that floats in after an action, like Saved successfully, and goes away on its own after a few seconds, with an optional Undo.

  • Component
    →

    AgentInbox

    A queue of what agents need from you: approvals, questions, failed runs and finished recaps.

  • Component
    →

    Alert

    Inline status banner that stays on the page.

  • Component
    →

    Drawer

    Edge panel for secondary tasks.