shadcn.io is not affiliated with official shadcn/ui
Reconnected Notification Block for React
A co-editor's back online notice drawn at the top centre of a document: it says what you missed, opens a catch-up list grouped by type with counts, and folds after a ten-second drain that holds on hover and focus.
Installation
Overview
Welcome people back and tell them what they missed, with this reconnected notice for React with Base UI. It's a document in Ropeline, a real-time co-editor, drawn in greys inside a hairline frame with a plus mark on each corner. A "Back online" card is drawn at the stage's top centre, "You missed 5 notifications", with a Catch up button and a Dismiss. Catch up opens, in the same card, the notifications that arrived while you were away, grouped by type (mentions, comments, shares) with a count on each group, each row with a dot and weight while it is unread and its time; Mark all read clears them. A drain bar runs along the card's foot for ten seconds, holds while the pointer or keyboard focus is on the card and doesn't run at all with reduced motion; when it ends the card folds, and the Catch up button in the top bar, with its count, is still there. It's built from Button and Guides, with CSS motion only. For editors, chat and any app that keeps working through a dropped connection.
FAQ
Did anything reconnect?
No. The notice is drawn: nothing reads your network, nothing was missed for real, and the page says so in its foot ("Demo: nothing reconnected"). Replay shows the notice again with every notification unread. In your app, show the card when your socket or online event fires, fill MISSED from what your server queued, and keep the offline half of this pair, notification-connection-lost, for when it drops.
Why does it fold by itself, and can I stop it?
A notice that has done its job shouldn't stay over the page. The drain bar is ten seconds of CSS (animate-out with a slide to the start side) and the card folds when its animation ends; hovering the card or moving focus onto it pauses the bar, and opening the list ends it for good, so nothing disappears while you are reading. The list never depends on the timer: the page's own Catch up button, with the unread count, stays in the top bar. With reduced motion the bar is not drawn and the card stays until you dismiss it, and the line in the foot says which of the two it is.
How is the catch-up list grouped?
MISSED is a typed list, each notification with a group (mentions, comments or shares), its text and its UTC time. GROUPS sets the order of the sections and each section counts its own unread ("2 new", then "all read"). Unread is a filled dot and a medium weight with an unseen "Unread" in the row's name; Mark all read makes every row regular, drops the dots and updates the counts and the top bar button.
How is this different from the connection lost notice?
That one is the offline bar with the edits waiting to send and a retry that counts; this one is what you see after: Back online, what arrived while you were away, and a way to catch up. Neither reads the network, and neither repeats the other's list.
Is it accessible?
The card is a named section with a heading, the list is a scrollable region you can reach with the keyboard, and a single polite status line says what each press did ("5 marked read. You are all caught up"). Dismiss and Mark all read are real buttons, Catch up in the top bar reports aria-expanded while the list is open, and the unread state is a dot, a weight and a word, never a colour.
Related
- Pro
Connection Lost Notification
Live and empty statesA whiteboard that keeps working offline: an offline bar docked at the foot with Retry now and its attempt count, the list of edits waiting to send, troubleshooting tips, and Work offline to fold it to a pill.
- Pro
The settings page of a form builder with its Save settings button: two success toasts are drawn on the page, and pressing Save raises a real toast through the block's own toaster, stacking up to three.
- 421Pro
Tabbed Inbox Notification
Bells and panelsA notification centre as a narrow panel: tabs for All, Mentions and Alerts with their own unread counts, rows you press to mark read, a mark all read for the open tab and a clear with an undo.
- Pro
Real-Time Notification Feed
Live and empty statesA live status feed that doesn't jump: a typed script of six events starts when you press Start, new ones wait in a pill above the list, and pressing the pill lets them in at the top.
- Pro
Connection Fallback Error
NetworkA full-screen page for a live connection that dropped and fell back: three signal bars, three transport rows with a shape and a word each, Reconnect now as a short scripted attempt, and a Keep using polling toggle.
- Pro
Connectivity Live Banner
Live statusA connection top bar for a collaborative editor, wired to the browser's online and offline events: Connected, then "You're offline" with a Retry now button and a tinted strip, then "Back online" for a few seconds.