shadcn.io is not affiliated with official shadcn/ui
Filter Panel Notification Block for React
An app window with filters at its start: type checkboxes with counts, priority toggles and an unread switch narrow the list, removable chips show what is on, and an empty result offers Clear.
Installation
Overview
Let people narrow a busy inbox without leaving it, with this filter window for React with Base UI. It is a framed app window of fixed height: a top bar with the screen's name and the unread count, then filters at the start and the list beside them. The filters are a group of Checkbox rows for five types, each with the number it would show under the other filters, a Toggle Group of three priorities that can be combined, and a Switch for unread only. The list narrows as you press, a polite status line in its foot says "Showing 4 of 10 notifications.", and every active filter is a removable chip over the list with Clear all beside them. A combination that matches nothing shows an Empty state with its own Clear filters button. The window keeps one height and the list scrolls inside it; on a phone the filters fold into a "Filters (2)" button above the list. It's built from Checkbox, Toggle Group, Switch, Badge, Button, Empty and Guides, with a CSS entrance only. For a release inbox, an alerts centre or any list with a few dimensions to filter by.
FAQ
How do I fill it with my own notifications and filters?
Edit NOTES at the top of the file. Each has an id, a kind (which type it counts under), a level (high, medium or low), a title, an ISO at time and whether it was unread when the page opened. KINDS and LEVELS list the filters. A notification passes when it matches every filter that is on: any of the chosen types, any of the chosen priorities, and unread if that is on. Counts, chips and the status line are all worked out from that one rule.
What do the numbers beside the types mean?
Each type's number is how many notifications it would show under the priority and unread filters that are on, so you see what a tick will do before you press it. With nothing else on they are the type totals; with Low priority on, Security shows 0. The type filters themselves don't change those counts, since ticking two types shows both.
What stays local, and how do I make it real?
Nothing is saved: the filters live in the page and reset on reload. In your app, keep them in the URL's query string so a filtered list can be shared and survives a refresh, and ask your API for the matching page and the per-type counts instead of filtering a typed list. The chips and Clear all only reset the three pieces of state, so they keep working unchanged.
What happens to focus when a filter is removed?
Removing a chip or pressing Clear all takes away the control that had focus, so focus moves to the list, which scrolls by keyboard. Ticking a type, pressing a priority or flipping the switch keeps focus where it is. When the list is empty its Clear filters button does the same as Clear all and the list takes focus again.
Is it accessible?
The types are a labelled group of real checkboxes, each named by its type and described by its count. The priorities are toggle buttons whose pressed state is announced, and the unread switch is named. Each chip's remove button says what it removes ("Remove filter: Comments"). Unread rows say "Unread" before the title, and every row names its type and priority in words, never only by its icon. The status line is a polite live region present from the start.
How does it look on a phone?
The window keeps its height. The filters become a "Filters (2)" button above the list with the count of what is on; it opens the group, which scrolls inside a short box so the list stays on screen. The chips stay in one row that scrolls sideways, and Clear all stays at its end.
Related
- /Pro
Search Results Notification
Sort and findA notification search in three bands: a search field with a slash key, type chips whose counts follow the query, and results with every match marked and an empty state that names the query.
- Pro
Inbox Reading Pane Notification
Bells and panelsA 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.
- 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.
- 621Pro
Digest View Notification
Quiet and digestsA 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.
- Pro
A developer inbox as a table: a checkbox, a mono repository name, the title and a reason tag per row, a select-all that shows a mixed state, and bulk Mark done and Unsubscribe with an Undo.
- Pro
Preference Matrix Notification
PreferencesA notification preference matrix: five kinds of notification down the page and four channels across, a checkbox in every cell, an all-types row that turns a channel on or off, marks on changed cells and an unsaved count.