Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Archive Retention Table Notification Block for React

An archive of notifications as a table whose auto-delete column is worked out again when you pick a retention period, with a restore per row, an undo, and an alert dialog before it empties.

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

Show people what happens to the notifications they set aside, with this archive for React with Base UI. A compact header holds the title and a labelled Native Select for how long archived notifications are kept: 30 days, 90 days or never. Inside a hairline frame with a plus mark on each corner, a native table lists six archived notifications with the date each was archived and a column that says when it will be deleted. That column is worked out again from each row's archive date and the page's fixed date whenever you change the menu, so a row past the window reads Deletes today, and a row that is soon due carries a clock and a heavier weight. Restore turns a row into a receipt in the same cells with an Undo. The foot's Empty archive button opens an Alert Dialog that names how many it removes; confirming leaves an Empty state with an Undo in the table's height. On a phone the last two columns fold into the notification's second line. Nothing is deleted anywhere. It's built from Native Select, Alert Dialog, Button, Empty and Guides. For an archive folder, a trash or any list with a retention period.

FAQ

How do I fill it with my own archive?

Edit ENTRIES (an id, a title, a line of desc and the ISO at time it was archived) and WINDOWS, the menu's choices with the number of days each keeps (zero means for ever). The Auto-deletes cell is deleteWord, which counts days between each row's at and AS_OF, a fixed constant, so the page reads the same on the server and in every time zone and never says "ago". Replace AS_OF with the real date in your app.

What stays local, and how do I make it real?

Restore, Empty archive and Undo only change the page's lists and reset on reload; nothing is deleted or restored on a server. To make it real, send the id from Restore, send the list of ids from the dialog's confirm handler, and let Undo send the reverse. The retention menu would be saved with the account; deleting at the end of the window is your server's job, and this table only shows when it will happen.

What does the alert dialog do?

Empty archive opens an alert dialog that says how many notifications it removes and offers Keep them or Empty archive. Escape or Keep them closes it with focus back on the button, and clicking outside does not close it. After you confirm, the table is replaced by an empty state of the same height with an Undo, and focus moves to that Undo a moment after the dialog closes. With nothing left to remove the button says so instead of opening.

What does Restore leave behind?

The row keeps its place and its height: its cells say "Restored to your inbox" and show an Undo, so nothing below it moves. Undo puts it back as an archived row with its dates. Emptying the archive finishes any receipts (they are already out of the archive), and the dialog counts only the rows still archived.

Is it accessible?

It is a native table with a caption, column headings and a row heading for each notification, in a labelled region that scrolls by keyboard. The Restore and Undo buttons name the notification they act on. The soon-to-delete state is a word, a clock and a heavier weight, never a color. The status line is a polite live region present from the start. The alert dialog opens with Keep them focused on every target, and Escape closes it.

How does it look on a phone?

The table keeps two columns: the notification and its Restore button. The date it was archived and when it will be deleted move into the notification's second line ("Archived Mon 12 Oct. In 18 days."), and the foot's button fills the width. The table's region is one fixed height, so restoring or emptying never moves the foot.

  • Pro

    A shared support inbox as an app window: a list of notifications under All, Unread and Archived views, and a reading pane with the sender, the time, the text, a context list and mark read, archive and undo.

  • 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

    Snooze Notification

    Quiet and digests

    A notification with a snooze popover: Later today, Tomorrow and Next week worked out from one fixed time, a custom hour, a Snoozed list with wake times and a Wake now that sends one back.

  • Pro

    Notifications grouped into Messages, Updates and Alerts in an accordion, each group with an unread count, its own mark read beside the trigger, a one-line summary when folded, and collapse and clear for the whole list.

  • Pro

    Digest View Notification

    Quiet and digests

    A morning digest panel: tabs for Today, Yesterday and This week, three cells of counts that roll to each period, sections with the top three items and +N more, and an email switch that sends nothing.