Billing Affiliate Commission Summary
A commission summary card for an affiliate or referral dashboard. It splits earnings into pending, approved, and lifetime totals, shows the next scheduled payout date and amount, and lists recent referrals with a status badge per row. Static by default so it can render directly from your affiliate tracking data.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its badge, button dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/billing-affiliate-commission-summary.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/billing/billing18.tsx instead.
Usage
The file also exports billing18Demo, 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 { Billing18, billing18Demo } from "@/components/blocks/billing/billing18"; export default function Page() { return <Billing18 {...billing18Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "Affiliate earnings" | Heading in the card header. |
| description | string | none | Optional supporting sentence under the heading. |
| pendingAmount | string | none | Formatted commission still pending, e.g. "$186.00". |
| approvedAmount | string | none | Formatted commission approved and queued for payout. |
| lifetimeAmount | string | none | Formatted lifetime commission total. |
| conversionRate | string | none | Optional formatted referral-to-paid conversion rate. Omitted from the card when not passed. |
| nextPayoutDate | string | none | Formatted date of the next scheduled payout. |
| nextPayoutAmount | string | none | Formatted amount expected in the next payout. |
| referrals | ReferralRow[] | none | Recent referral rows, rendered in the order given. |
| detailsLabel | string | "View payout history" | Label on the footer link. |
| detailsHref | string | "#" | Destination for the footer link. |
| className | string | none | Extra classes for the outer card. |
Types
interface ReferralRow { id: string; customer: string; date: string; amount: string; status: "pending" | "approved" | "paid"; }
Behavior notes
- pendingAmount, approvedAmount, and lifetimeAmount are plain formatted strings, not numbers, so currency formatting is entirely up to the caller.
- Referral status uses a fixed 3-value union (pending, approved, paid) mapped to badge colors in STATUS_STYLES.
- conversionRate only renders when passed, so the block works without it for programs that don't track referral clicks.
- The referrals list has no pagination or sorting built in; pass it already sorted and trimmed to whatever length fits your dashboard.
- View payout history renders as a next/link via the Button component's render prop, pointing detailsHref at a dedicated payout history page.
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.