Staaarter

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.

By Staaarter Team
Billing
Updated July 8, 2026
Docs
Live preview

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.json

Prefer 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

PropTypeDefaultDescription
headingstring"Request a refund"Heading shown at the top of the form.
descriptionstringnoneOptional supporting line under the heading.
transactionsRefundableTransaction[]noneTransactions the user can pick from, rendered as selectable rows.
reasonsstring[]noneReason options rendered as selectable pill buttons.
submitLabelstring"Submit request"Label on the submit button before it's clicked.
classNamestringnoneExtra 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