Refund Picker

Refund Picker is a copy-paste React component that stops refund smaller than the customer expected before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/refund-picker
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsRefund smaller than the customer expected

Was this component page useful?

How do I install Refund Picker?

pnpm dlx shadcn@latest add @bollard/refund-picker

The files land in your project. They're yours to edit.

How do I use Refund Picker in React?

refund-picker-usage.tsx
import { RefundPicker } from "@/components/ui/refund-picker"

<RefundPicker
  now="2026-10-13T10:00:00+05:30"
  items={[
    { id: "buds", name: "Wireless earbuds", quantity: 1, unitPrice: 2499, restockingPercent: 10, restockingReason: "opened" },
    { id: "case", name: "Silicone case", quantity: 2, unitPrice: 299 },
    { id: "card", name: "₹500 gift card", quantity: 1, unitPrice: 500, nonRefundable: "Gift cards can't be refunded" },
  ]}
  defaultValue={{ buds: 1, case: 1 }}
  shippingPaid={79}
  returnShippingFee={60}
  methods={[
    { id: "card", label: "Original card", detail: "Visa •••• 4242", days: [5, 7] },
    { id: "upi", label: "UPI", detail: "tushar@okhdfcbank", days: [2, 3] },
    { id: "credit", label: "Store credit", days: [0, 0], waivesFees: true, caveat: "Can't be moved to your bank later" },
  ]}
  onConfirm={() => new Promise((resolve) => setTimeout(resolve, 900))}
/>

What input mistakes does Refund Picker catch?

  • Units per item, never more than were bought
  • A custom amount above what the picked items allow
  • Restocking and return-shipping deductions, each named
  • Non-refundable items, kept visible with the reason
  • Net amount and arrival window per refund method
  • Missing refund method before confirm

What props does Refund Picker accept?

RefundPicker props
PropTypeDefault
items* (required)

Items on the order, with quantity, price and refund rules.

RefundItem[]—
methods* (required)

Where the refund can go, with arrival windows and fees.

RefundMethod[]—
value

Controlled units chosen per item id.

Record<string, number>—
defaultValue

Starting units per item id when uncontrolled.

Record<string, number>{}
onValueChange

Called with units per item id after every change.

(picked: Record<string, number>) => void—
method

Controlled refund method id. Defaults to the first method, which should be the original payment.

string—
defaultMethod

Starting refund method id when uncontrolled.

string—
onMethodChange

Called with the chosen refund method id.

(id: string) => void—
shippingPaid

Original shipping charge, refunded when everything is returned.

number0
returnShippingFee

Return-shipping fee deducted from the refund.

number0
now

When the refund is issued, for the arrival dates. Pass it for deterministic rendering; otherwise the clock is read after mount.

Date | string—
currency

ISO 4217 currency code.

string"INR"
locale

Locale for money and date formatting.

string"en-IN"
onConfirm

Issues the refund. Return a promise to show a pending state; a rejection keeps the form.

(refund: { amount: number; method: string; picked: Record<string, number> }) => void | Promise<void>—
messages

Every visible string (see `REFUND_PICKER_MESSAGES`). The single-string props below still work and win.

Partial<RefundPickerMessages>—
titlestring—
confirmLabel(amount: string, method: string) => string—
shippingNote(amount: string) => string—
amountToggleLabelstring—
amountLabel(max: string) => string—
amountCancelLabelstring—
overText(max: string) => string—

* required. Also accepts the native props of <section> (className, aria-*, data-*…), passed through to it.

How is Refund Picker accessible?

  • Section labelled by its title; each item's stepper is a labelled group with a polite <output>
  • Custom amount has a <label>, aria-invalid when over the cap, and a polite hint via aria-describedby
  • Refund methods are a labelled radiogroup of native radios
  • Confirm sets aria-busy while pending; icons are aria-hidden

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

This is a UX guard rail. Enforce on the server: Recompute the refundable amount from order data on the server, cap it, and make the refund request idempotent.

  • Arrival dates come from the ranges you pass; banks may take longer
  • Policy (fees, eligibility) is yours to supply; it does not know your return rules
  • Money is computed with JS numbers; round on the server

What expensive mistakes does Refund Picker stop?

Refund smaller than the customer expected

Also known as

refund · return · partial refund · store credit · restocking fee · order details · admin · returns

Field type

What dependencies does Refund Picker require?

Refund Picker facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameRefund Picker
Registry identifier@bollard/refund-picker
Install commandnpx shadcn@latest add @bollard/refund-picker
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Refund Picker

How does Refund Picker prevent financial transaction errors?

Refund Picker prevents refund smaller than the customer expected. Blocks Units per item, never more than were bought, A custom amount above what the picked items allow, Restocking and return-shipping deductions, each named, Non-refundable items, kept visible with the reason, Net amount and arrival window per refund method, Missing refund method before confirm before processing. Limitation: apply idempotency keys for refund-picker.

How do I install refund-picker with shadcn?

Run `npx shadcn@latest add @bollard/refund-picker`. Sources added: registry/default/refund-picker/refund-picker.tsx. Package requirements: lucide-react.

What props customize Refund Picker?

Refund Picker accepts `items`, `methods`, `value`, `defaultValue`, `onValueChange`. Configures refund, return, partial refund behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of refund-picker?

Arrival dates come from the ranges you pass; banks may take longer. Policy (fees, eligibility) is yours to supply; it does not know your return rules. Money is computed with JS numbers; round on the server Server requirement: Recompute the refundable amount from order data on the server, cap it, and make the refund request idempotent.

How does Refund Picker meet accessibility guidelines?

Section labelled by its title; each item's stepper is a labelled group with a polite <output>. Custom amount has a <label>, aria-invalid when over the cap, and a polite hint via aria-describedby. Refund methods are a labelled radiogroup of native radios. Confirm sets aria-busy while pending; icons are aria-hidden. Minimizes errors: refund amount wrong, restocking fee surprise.

Which components pair with Refund Picker?