Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Real-Time Notification Feed Block for React

A 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.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Let new notifications arrive without moving what someone is reading, with this live feed for React with Base UI. It's the status feed of Beatloft, an ops status page, as a narrow list in a hairline frame with a plus mark on each corner. A control band holds a Switch, "Show new ones automatically", a live dot with its word (Ready, Live, Paused, Done) and one button. Pressing "Start the feed" plays a typed script of six events, one every couple of seconds, and the same button becomes Pause. With the switch off each arrival waits in a pill above the list ("3 new notifications", the number rolling in a Sliding Number) while the rows below stay where they are; pressing the pill lets them in at the top with a short highlight. With the switch on they come in at once. A polite status line says what is happening. It's built from Switch, Sliding Number, Button and Guides, with CSS entrances only. For an ops console, a chat or any list that updates while it is read.

FAQ

Where do the events come from, and how do I make it real?

From the file: ARRIVALS holds six typed events and "Start the feed" lets them in on a short wait, so nothing is received and a reload starts again. The feed never starts on its own. To make it real, replace the script with your stream (a socket, server-sent events or polling): put what arrives into the same queue, keep pulled as how many the reader has let in, and the pill, the count and the list follow. The wait between events is GAP.

What runs in the background, and can I stop it?

Only the script, and only after you press Start: one timer at a time, cleared when you press Pause, when the feed ends and when you leave the page. Pause keeps what has come; Resume carries on; once all six have arrived the button reads "Start again", which clears the list back to its five events and runs the script again. There is no timer on load and nothing loops but the live dot, which pulses only while the feed runs and not under reduced motion.

How does the pill keep the list from jumping?

The pill sits in its own row of one height, so it appearing or going never moves the list. The list is a fixed height that scrolls inside, so letting rows in at the top pushes older ones down inside it, never the page; the rows you are reading stay as they are until you press the pill. After you press it, focus moves to the newest row's title.

Is it accessible?

The status line is a polite live region and says "2 new notifications waiting." as they arrive, "2 added at the top." when you let them in, and what the Pause and Start buttons did. The pill's name says what it does ("Show 2 new notifications"). Unread rows are a dot, a heavier title and the word "Unread" for a screen reader, never a colour, and the switch is named by its text. Under reduced motion the rows simply appear, with no highlight.

What does the switch do when there is a queue?

Turning it on lets everything waiting in at once ("2 added at the top. New ones now come in at once.") and later arrivals appear as they come. Turning it off makes later arrivals wait in the pill again. Neither moves the rows you are reading except by adding to the top.

How does it look on a phone?

The switch and the buttons stack, the pill row keeps its height with or without the pill, and each row keeps a fixed height with its title and detail on one line each. The list scrolls inside its box.

  • Pro

    A 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

    An inbox with an unread-only switch and a live count, where a row you read stays in place until you turn the switch off, and zero unread is a designed Inbox zero state.

  • Pro

    The list under a CRM's notification bell, shown open under its top bar: five notifications that mark themselves read when pressed, a bell whose count and name go down with them, Mark all read and See all.

  • Pro

    A project's history as a vertical timeline split in two: six event types as chips with live counts in a start column, and the timeline of who did what beside them, filtered by the types you press, with Load earlier events and a designed empty state.

  • Pro

    A UI kit's count badge drawn on three header buttons: a number field sets the bell, a toggle switches number and dot, and each cell prints what is shown and what a screen reader hears.

  • Pro

    Three reminders from a scheduling assistant as a deck of cards: Dismiss lets the next one come forward, Show all fans the deck into a list, and an empty deck says all caught up with a Reset.