Notification centre
A React component in Beamline's Feedback category, in the free sample.
Updates that wait to be read: a bell with the unread count opens All / Unread, new and earlier groups, and per item mark read or dismiss.
Use it for
- Mentions, results and alerts people read later.
Not for
- Immediate feedback on an action (toast).
Anatomy
- bell with count (the count rolls; it arrives from a little smaller)
- panel header (filter, mark all)
- groups
- item (icon or avatar, title, line, time, unread dot, actions that wait for attention)
- empty state
States
- unread
- read (the dot fades and shrinks away)
- pointed at / focus inside (actions show, the dot steps aside)
- filtered
- empty
Keyboard
- Tab through items and their actions
- Escape closes
Motion
The panel grows from the bell. Opens out of its trigger (_shared/overlay.module.css, source morph): the layer starts as the trigger's own box, offset onto it, and grows; the side next to the trigger is there at once so the nearest rows read within the ruled 90 ms, the far side settles by ~200 ms, content fades in over 90 ms; it closes back into the trigger in 180 ms. Until it has grown the press that opened it cannot land on a row. Reduced motion: it appears. Inside, the list keeps its path: a dismissed or filtered-out row leaves a fading ghost while the rows below close the gap, and a row that comes back grows in (useFlip). Marking read fades the dot over --pui-motion-out; the bell's count rolls to its new number. A row's actions arrive at once on hover or focus and leave over --pui-motion-out; on touch they show, and the row keeps room for them.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
notifications | { id, title, description?, time, tone?, actor?, read?, href?, earlier? }[] | — | Notifications displayed in the inbox. Required. |
onReadChange / onDismiss / onOpen | callbacks | — | onReadChange: Reports read receipts after a change; no callback by default. onDismiss: Runs the dismissal action for the notification; no handler by default. onOpen: Opening an item; with href the link opens too. |
open / onOpenChange / align | mixed | — | open: Controlled open state; omit to use defaultOpen. onOpenChange: Reports open state after a change; no callback by default. align: Alignment within the available space. Defaults to "end". |
style / ref | CSSProperties / native Ref | — | style: Inline styles on the documented visual root; no inline overrides by default. ref: Receives the button or trigger; no ref by default. |
classNames | NotificationCenterClassNames | — | Classes for the named visual parts; no part overrides by default. |
NotificationItem.tone | "neutral" | "accent" | "success" | "warning" | "danger" | "info" | "mention" | — | Semantic notification colour; mention remains a deprecated alias for accent. |
label | string | — | The bell's name. Default "Notifications". |
onReadChange | ((notification: NotificationItem, read: boolean) => void) | — | Reports read receipts after a change; no callback by default. |
onDismiss | ((notification: NotificationItem) => void) | — | Runs the dismissal action for the notification; no handler by default. |
onOpen | ((notification: NotificationItem) => void) | — | Opening an item; with href the link opens too. |
open | boolean | — | Controlled open state; omit to use defaultOpen. |
defaultOpen | boolean | — | Initial open state when uncontrolled. Defaults to false. |
onOpenChange | ((open: boolean) => void) | — | Reports open state after a change; no callback by default. |
align | "center" | "end" | "start" | — | Alignment within the available space. Defaults to "end". |
style | CSSProperties | — | Inline styles on the documented visual root; no inline overrides by default. |
ref | Ref<HTMLButtonElement> | — | Receives the button or trigger; no ref by default. |
className | string | — | Classes on the documented visual root; no override by default. |
Built from
Dependencies
@radix-ui/react-popover, lucide-react
Import
import { NotificationCenter } from "@beamline/notification-center";
Get it
Notification centre is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Notification centre is included in the free MIT sample. Get Beamline · Connect your agent
More in Feedback
- Timer: A duration that counts down (or up) from your clock: Start, Pause, Resume, Reset and the finish reported once; the time left drawn as a bar you drag (or…
- Usage meter: An allowance and what fills it: one bar split by source, the room left, a warning near the limit and the overflow in its own red well past a notch at the…
- Alert: A message that stays until it is dealt with: what happened, what to do, an action; danger and warning are announced; dismissing folds its height away.
- Cookie consent: Asks once which cookies a visitor allows, with Reject all and Accept all given equal weight; Customise grows the notice in place into each category with…
- Empty state: What a place will hold and the first step to fill it, instead of a blank; a compact size for panels and filtered tables.
- Spinner: A ring that spins while work runs and closes into a drawn check or cross when it ends.
- Announcement bar: A banner across the top for news and offers: messages take turns, a countdown ticks, and dismissing folds it away and can remember it.
- Progress: How much of a known task is done, or a moving bar when the length is unknown, with an optional label and value.
- Skeleton: Holds the shape of content while it loads, then crossfades into it, so nothing jumps.