Billing Notification Center
A notification panel dedicated to billing events, failed payments, low balances, upcoming renewals, and payment confirmations. Each item shows a type icon, a title, a message, and how long ago it happened, with per-item mark-as-read and dismiss controls and an unread count badge in the header. Built for account settings pages and dashboards where billing alerts need their own home instead of getting lost in a general activity feed.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/billing-notification-center.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/billing/billing79.tsx instead.
Usage
The file also exports billing79Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.
import { Billing79, billing79Demo } from "@/components/blocks/billing/billing79"; export default function Page() { return <Billing79 {...billing79Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "Billing notifications" | Header text above the list. |
| notifications | NotificationItem[] | none | Initial notification list. Copied into local state on mount, so mark-as-read and dismiss update the UI without a controlled prop. |
| emptyMessage | string | "You're all caught up. No billing alerts right now." | Text shown once every notification has been dismissed. |
| className | string | none | Extra classes for the outer container. |
Types
type NotificationType = "error" | "warning" | "info" | "success"; interface NotificationItem { id: string; type: NotificationType; title: string; message: string; timeAgo: string; read?: boolean; actionLabel?: string; actionHref?: string; }
Behavior notes
- The notifications prop only seeds initial state, it's copied into a local useState array on mount. Mark-as-read and dismiss both act on that local copy, not the prop, so re-rendering with a new notifications array after mount won't reset the list.
- type drives the icon and color through an internal lookup (error, warning, info, success), so callers only ever pass one of those four plain strings, never a component.
- Unread items get a subtle background tint and a small dot next to the title; the header badge counts them and disappears once the count hits zero.
- Dismissing the last item swaps the list for an empty state with a BellOff icon and emptyMessage, rather than leaving a blank panel.
- actionHref and actionLabel are optional per item; when both are set, a small inline link appears next to the timestamp, otherwise it's omitted.
Frequently asked questions
More Billing Blocks
View all →Billing Invoice List
Invoice history table with status badges, formatted amounts, and a per-row download link, built with shadcn/ui and Tailwind CSS.
Billing Failed Payment Alert
High-contrast failed-payment alert with a message, a retry button, and an optional update-payment-method button, built with shadcn/ui and Tailwind CSS.
Billing Credit Balance
Compact credit balance card with a large total, an optional purchased-versus-promotional breakdown, a low-balance notice, and a top-up button.
Billing Payment Methods
A saved payment method list for React and Next.js with brand icons, a default badge, near-expiry warnings, and remove/set-default actions per row.
Billing Add Card
A card entry form for React and Next.js with auto-formatted fields, internal brand detection, and per-field validation feedback built with shadcn/ui and Tailwind CSS.
Billing Coupon Code
An inline promo code input for React and Next.js with a simulated loading state, an applied summary showing the discount amount, and an invalid-code message.