Billing Credit Refund Request
A self-contained refund request flow, pick a transaction, choose whether the refund goes to credit balance or the original payment method, select a reason, and add an optional note. Submitting shows a loading state, then a confirmation panel with a generated ticket id. Built for billing pages where customers request money back for unused credit or an overcharge without opening a support ticket by email.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button, label, textarea dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/billing-credit-refund-request.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/billing/billing41.tsx instead.
Usage
The file also exports billing41Demo, 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 { Billing41, billing41Demo } from "@/components/blocks/billing/billing41"; export default function Page() { return <Billing41 {...billing41Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "Request a refund" | Heading shown at the top of the form. |
| description | string | none | Optional supporting line under the heading. |
| transactions | RefundableTransaction[] | none | Transactions the user can pick from, rendered as selectable rows. |
| reasons | string[] | none | Reason options rendered as selectable pill buttons. |
| submitLabel | string | "Submit request" | Label on the submit button before it's clicked. |
| className | string | none | Extra classes for the outer form element. |
Types
interface RefundableTransaction { id: string; label: string; amount: string; date: string; }
Behavior notes
- Submit stays disabled until a transaction and a reason are both selected; the optional note field doesn't gate submission.
- Selecting a transaction, refund method, and reason are three separate radiogroups built from plain buttons, not a native select, so they're fully keyboard and screen-reader navigable.
- Submitting sets a brief "submitting" state with a spinner before swapping the whole form for a confirmation panel; there's no real network request, the delay and ticket id are simulated client-side.
- The generated ticket id is derived from the current timestamp at submit time, so it's only computed after a user interaction and never during server rendering.
- There's no prop to hook into submission, wire your own submit handler in place of the built-in setTimeout if you need to call a real API.
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.