Billing Portal Link
A simple entry point to a hosted billing portal, like the Stripe Customer Portal, so users can manage cards, invoices, and plan changes without your app building that UI itself. The card lists what the portal covers and links out to it, with an optional banner for when someone has just returned from the portal after making a change. Built for billing settings pages that hand off the heavy lifting to a provider-hosted flow.
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-portal-link.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/billing/billing96.tsx instead.
Usage
The file also exports billing96Demo, 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 { Billing96, billing96Demo } from "@/components/blocks/billing/billing96"; export default function Page() { return <Billing96 {...billing96Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | "Manage your billing" | Heading shown above the description. |
| description | string | none | Optional one-line summary of what the portal is for. |
| portalHref | string | none | URL for the hosted billing portal session; the whole card exists to link here. |
| ctaLabel | string | "Open billing portal" | Label on the button that links to portalHref. |
| highlights | PortalHighlight[] | [] | Short list of what the portal covers, each with an icon and a label. |
| returnedFromPortal | boolean | false | When true, shows a confirmation banner above the title for someone landing back from the portal. |
| className | string | none | Extra classes for the outer card. |
Types
interface PortalHighlight { icon: "card" | "invoice" | "seats"; label: string; }
Behavior notes
- portalHref is meant to be a fresh, single-use portal session URL, generated server-side per request, not a static link, since providers like Stripe expire these sessions.
- highlight icons are chosen from a fixed internal set (card, invoice, seats) mapped to lucide icons, so callers pass a plain string key rather than an icon component.
- returnedFromPortal shows a small confirmation banner above the title; pass it as true when the current page load's query string indicates a return from the portal's return_url.
- The button is a next/link styled as a button, not a real button element, so it works as a plain outbound link without any client-side handler.
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.