Toast Notification Stack
A corner stack whose live region is mounted before any message exists, errors announce assertively, and the auto-dismiss timer pauses on hover and on focus.
A day's notifications collapsed into one digest, grouped by what they are rather than when they arrived.
components/notification-digest-list.tsxnpx hoverlab add notification-digest-list
Or over MCP, from your editor's agent — no account needed.
Free to read, copy and install, for personal and non-commercial projects. Shipping it in client work or a paid product needs Pro ($79 once). The source lands in your repo and stops being ours — no attribution, nothing to upgrade.
Start a page with this section — add more, order them, and leave with the page source.
The alternative is fourteen separate emails, which is how a notification system trains people to filter it into a folder they never open.
Rendered live in your current theme — this is the same component whose source is below, not a screenshot of it.
'use client'
/**
* <NotificationDigestList> — A day's notifications collapsed into one digest, grouped by what they are rather than when they arrived.
*
* The layout problem is that a digest has two competing orders: the order
* things happened, and the order they matter. The obvious wrong answer is
* chronological, which is what an inbox already does and is exactly why a
* digest is being sent instead — fourteen timestamped lines are the thing
* the reader was trying to escape.
*
* So the rows are grouped by kind and the badge carries the count, which
* means a reader who only looks at the badges still leaves with the day's
* shape: three deploys, one failure, six comments.
*
* The badge says "1 failed", not "critical". That split — `status` for the
* words, `tone` for the colour — exists because the tone names are
* developer-facing tokens, and a pill reading "neutral" beside a row is a
* label with no meaning to anyone reading the page. Colour alone would also
* be the only carrier of "this one is bad", which fails for the reader who
* cannot distinguish it; the words are the fallback that makes the colour
* redundant rather than load-bearing.
*
* Each row is a <button> with `aria-pressed`, not a div with an onClick. It
* is operable, so it has to be focusable, activate on Enter and Space, and
* announce whether it is the selected one — `aria-pressed` is the attribute
* that carries the last of those, and a div carries none of the three.
*
* The demo selects the first row. Selecting none would render the panel in
* a state a reader never sees in use, and selecting the failure would teach
* that the badge colour drives the selection, which it does not.
*/
import * as React from 'react'
type Tone = 'neutral' | 'positive' | 'warning' | 'critical'
export interface NotificationDigestListRow {
id: string
label: string
detail?: string
tone?: Tone
/** What the badge says. Falls back to the tone name when absent. */
status?: string
}
export interface NotificationDigestListProps {
heading?: string
intro?: string
rows?: NotificationDigestListRow[]
className?: string
}
/*
Tones as complete utility classes, never assembled from fragments.
Tailwind scans source text, so `text-${tone}-foreground` produces no
class at all — the same failure as an undefined token, and just as
invisible in review.
*/
const TONE_CLASS: Record<Tone, string> = {
neutral: 'bg-muted text-muted-foreground',
positive: 'bg-primary/10 text-primary',
warning: 'bg-accent text-accent-foreground',
critical: 'bg-destructive/10 text-destructive',
}
const ROWS: NotificationDigestListRow[] = [
{ id: "row-1", label: "3 deploys shipped", detail: "All green. The last one is still inside its rollback window.", tone: "positive", status: "3 deploys" },
{ id: "row-2", label: "1 build failed", detail: "api-gateway on main — the test that failed also failed on the previous run.", tone: "critical", status: "1 failed" },
{ id: "row-3", label: "6 comments on your reviews", detail: "Two are blocking, four are questions you can answer in a line.", tone: "neutral", status: "6 comments" },
{ id: "row-4", label: "Usage at 82% of plan", detail: "On the current run rate you cross the limit on the 26th.", tone: "warning", status: "82% used" },
{ id: "row-5", label: "2 people joined the workspace", detail: "Both are still on the default role and have not opened anything.", tone: "neutral", status: "2 joined" },
]
export function NotificationDigestList({
heading = "Yesterday, in one message",
intro = "The alternative is fourteen separate emails, which is how a notification system trains people to filter it into a folder they never open.",
rows = ROWS,
className,
}: NotificationDigestListProps) {
/*
Per-instance prefix for every id this block emits.
The literals these replaced were a latent duplicate the moment the
block appeared twice on one document, and `aria-labelledby` on a
duplicated id resolves to the first match -- so the second copy was
labelled by the first copy's heading. Client component, so `useId` is
the right tool.
*/
const uid = React.useId()
const [selected, setSelected] = React.useState<string | null>(rows[0]?.id ?? null)
return (
<section
aria-labelledby={`${uid}-notification-digest-list-heading`}
className={`w-full bg-background px-6 py-16 ${className ?? ''}`}
>
<div className="mx-auto max-w-3xl">
<h2
id={`${uid}-notification-digest-list-heading`}
className="text-2xl font-semibold tracking-tight text-foreground"
>
{heading}
</h2>
<p className="mt-2 text-sm text-muted-foreground">{intro}</p>
<ul className="mt-8 divide-y divide-border overflow-hidden rounded-xl border border-border bg-card">
{rows.map((row) => {
const isSelected = row.id === selected
return (
<li key={row.id}>
{/*
A button, not a div with onClick. The row is operable, so
it has to be reachable by keyboard and announce its
selected state — aria-pressed is what carries that.
*/}
<button
type="button"
aria-pressed={isSelected}
onClick={() => setSelected(row.id)}
className={`flex w-full items-center justify-between gap-4 px-5 py-4 text-start transition-colors hover:bg-muted/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset ${
isSelected ? 'bg-muted/40' : ''
}`}
>
<span className="min-w-0 flex-1">
<span className="block truncate text-sm font-medium text-foreground">
{row.label}
</span>
{row.detail ? (
<span className="mt-0.5 block text-sm text-muted-foreground">
{row.detail}
</span>
) : null}
</span>
<span
className={`shrink-0 rounded-full px-2.5 py-1 text-xs font-medium ${
TONE_CLASS[row.tone ?? 'neutral']
}`}
>
{row.status ?? row.tone ?? 'neutral'}
</span>
</button>
</li>
)
})}
</ul>
</div>
</section>
)
}
bg-card, text-muted-foreground) — it inherits your theme instead of overriding it.Drop it at components/notification-digest-list.tsx and import it where you need the section:
import { NotificationDigestList } from '@/components/notification-digest-list'1 of this block’s props are simple enough to drive from here. Change them and the block below re-renders — it is the same component whose source is above, not a mock of it. Everything else it accepts is in the table underneath.
Read out of the component’s own type and signature, so this cannot drift from the source below. Every prop has a default — the component renders standalone before you pass it anything.
| Prop | Type | Default |
|---|---|---|
heading | string | "Yesterday, in one message" |
intro | string | — |
rows | NotificationDigestListRow[] | ROWS |
className | string | — |
The same block rendered once to markup, wrapped as a file your framework compiles. Tailwind classes are framework-agnostic, so the design transfers intact — the behaviour does not.
This block is interactive. The markup below is its initial state with the event handlers stripped — you will need to re-wire the behaviour in your framework.
<!--
Notification Digest — markup from the Hoverlab catalog.
This is the block rendered once to HTML and wrapped as a component
file. It is not a port of the React source: the Tailwind classes carry
the design, which is the part that took the work, and they are the same
in every framework.
This block is interactive in React and the handlers are NOT here.
Buttons, toggles and menus render in their initial state and do
nothing until you wire them up.
-->
<section aria-labelledby="_R_0_-notification-digest-list-heading" class="w-full bg-background px-6 py-16 ">
<div class="mx-auto max-w-3xl">
<h2 id="_R_0_-notification-digest-list-heading" class="text-2xl font-semibold tracking-tight text-foreground">Yesterday, in one message</h2>
<p class="mt-2 text-sm text-muted-foreground">The alternative is fourteen separate emails, which is how a notification system trains people to filter it into a folder they never open.</p>
<ul class="mt-8 divide-y divide-border overflow-hidden rounded-xl border border-border bg-card">
<li>
<button type="button" aria-pressed="true" class="flex w-full items-center justify-between gap-4 px-5 py-4 text-start transition-colors hover:bg-muted/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset bg-muted/40">
<span class="min-w-0 flex-1">
<span class="block truncate text-sm font-medium text-foreground">3 deploys shipped</span>
<span class="mt-0.5 block text-sm text-muted-foreground">All green. The last one is still inside its rollback window.</span>
</span>
<span class="shrink-0 rounded-full px-2.5 py-1 text-xs font-medium bg-primary/10 text-primary">3 deploys</span>
</button>
</li>
<li>
<button type="button" aria-pressed="false" class="flex w-full items-center justify-between gap-4 px-5 py-4 text-start transition-colors hover:bg-muted/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset ">
<span class="min-w-0 flex-1">
<span class="block truncate text-sm font-medium text-foreground">1 build failed</span>
<span class="mt-0.5 block text-sm text-muted-foreground">api-gateway on main — the test that failed also failed on the previous run.</span>
</span>
<span class="shrink-0 rounded-full px-2.5 py-1 text-xs font-medium bg-destructive/10 text-destructive">1 failed</span>
</button>
</li>
<li>
<button type="button" aria-pressed="false" class="flex w-full items-center justify-between gap-4 px-5 py-4 text-start transition-colors hover:bg-muted/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset ">
<span class="min-w-0 flex-1">
<span class="block truncate text-sm font-medium text-foreground">6 comments on your reviews</span>
<span class="mt-0.5 block text-sm text-muted-foreground">Two are blocking, four are questions you can answer in a line.</span>
</span>
<span class="shrink-0 rounded-full px-2.5 py-1 text-xs font-medium bg-muted text-muted-foreground">6 comments</span>
</button>
</li>
<li>
<button type="button" aria-pressed="false" class="flex w-full items-center justify-between gap-4 px-5 py-4 text-start transition-colors hover:bg-muted/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset ">
<span class="min-w-0 flex-1">
<span class="block truncate text-sm font-medium text-foreground">Usage at 82% of plan</span>
<span class="mt-0.5 block text-sm text-muted-foreground">On the current run rate you cross the limit on the 26th.</span>
</span>
<span class="shrink-0 rounded-full px-2.5 py-1 text-xs font-medium bg-accent text-accent-foreground">82% used</span>
</button>
</li>
<li>
<button type="button" aria-pressed="false" class="flex w-full items-center justify-between gap-4 px-5 py-4 text-start transition-colors hover:bg-muted/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset ">
<span class="min-w-0 flex-1">
<span class="block truncate text-sm font-medium text-foreground">2 people joined the workspace</span>
<span class="mt-0.5 block text-sm text-muted-foreground">Both are still on the default role and have not opened anything.</span>
</span>
<span class="shrink-0 rounded-full px-2.5 py-1 text-xs font-medium bg-muted text-muted-foreground">2 joined</span>
</button>
</li>
</ul>
</div>
</section>
What each framework gets across the whole catalog — effects convert properly; this rung is markup.
The component, its props, the design tokens it expects and the command that installs it — as one prompt. Paste it into Claude, Cursor, v0 or ChatGPT and what they build around it will match the rest of the catalog instead of inventing its own system.
Want the whole screen instead of this one section? Open a page and copy it entire.
All of them free to read, copy and install — no account, no locked tiles, no watermarked preview. The whole catalog is open, and so are the API and the CLI.
Browse NotificationsCopying the code is free. Putting it in client work or a paid product is what Pro is for — the licence, not the access.
A corner stack whose live region is mounted before any message exists, errors announce assertively, and the auto-dismiss timer pauses on hover and on focus.
The bell panel: filterable list with read state, the unread count in the accessible name rather than only in a badge, and machine-readable timestamps beside the human ones.
Per-event, per-channel switches as a real table, with required notifications locked and explained, and column headers that toggle a whole channel and report a mixed state honestly.
The soft ask before the browser dialog you only get one shot at — what will be sent, what will not, and a decline of the same weight as the yes.
The control that turns notification volume down instead of off, which is the choice most people actually want.
Which channel carries which event, so the loud ones can be moved rather than muted entirely.