shadcn.io is not affiliated with official shadcn/ui
Portal Link Billing Block for React
Share a scoped, expiring link to the billing portal with your accountant: pick what they see and for how long, copy the link, and revoke it later from a list of links you made.
Installation
Overview
Give an accountant or a colleague a way into the invoices without a login, with this portal link section for React with Base UI. A hairline frame with a plus mark on each corner, ruled by Guides, holds two Native Selects, what they can see (invoices only, or invoices and payment methods) and how long the link works (1, 7 or 30 days, with the end date worked out from a fixed day), and a Shine Button that creates it. The link appears in a read-only mono field with a Copy Button, the day it expires and Revoke. Under it, "Links you made" lists the earlier ones in a scroll region of fixed height, each with a Badge that says Active, Expired or Revoked and a Revoke button. For accounting tools, agencies and any account with an outside bookkeeper.
FAQ
How do I change the scopes, the lifetimes and the earlier links?
Edit SCOPES, DAYS and EARLIER (each link has a scope, the day it was made, the last day it works and a token), and HOST. The state of each link is worked out from its dates and whether it was revoked, against the typed AS_OF day.
What does Revoke do?
It marks the link Revoked in the list and in the result, turns its button off and says so in the status line. A link that has already expired or been revoked cannot be revoked again. Nothing leaves the page: in your app, revoking must be a call that stops the link working on your server.
What stays local, and how do I wire it for real?
Copy is real. The link is a sample on an .example host and opens nothing, and the list lives in the page. Your billing provider's hosted portal makes the real link: create it on the server with the scope and the expiry, and return its address to create.
Why does the list scroll instead of growing?
So that creating a link never moves the panel. The list holds about three rows and scrolls past that; the region is a tab stop, so the keyboard can reach the rest.