Billing Partner Discount
A panel listing partner-program discounts already applied to an account, startup credits, accelerator perks, or community deals, each with the partner's initials, a kind badge (percentage off or fixed credit), the value, remaining balance, and expiry date. An optional form at the bottom lets a user enter a new partner code. Built for the moment a partnership perk needs to feel like a first-class part of the billing page, not a buried line item.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its badge, button, input, label dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/billing-partner-discount.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/billing/billing84.tsx instead.
Usage
The file also exports billing84Demo, 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 { Billing84, billing84Demo } from "@/components/blocks/billing/billing84"; export default function Page() { return <Billing84 {...billing84Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "Partner discounts" | Panel heading. |
| description | string | none | Optional line under the heading. |
| discounts | PartnerDiscount[] | none | Applied discounts rendered as a list, in the order given. |
| showRedeemForm | boolean | true | Whether the "have a code?" input and button render below the list. |
| redeemLabel | string | "Have a partner code?" | Label above the redeem input. |
| redeemPlaceholder | string | "Enter code" | Placeholder text for the redeem input. |
| redeemButtonLabel | string | "Apply" | Label for the redeem form's submit button. |
| className | string | none | Extra classes for the outer container. |
Types
type DiscountKind = "percentage" | "credit"; interface PartnerDiscount { id: string; partnerName: string; partnerInitial: string; kind: DiscountKind; value: string; remaining?: string; validUntil?: string; infoHref?: string; }
Behavior notes
- partnerInitial is a plain string you set per discount (e.g. "YC", "AW"), rendered inside a colored circle instead of a real logo image, so there's no image loading or fallback state to manage.
- kind only controls the badge text through an internal lookup (percentage -> "Percentage off", credit -> "Fixed credit"); value itself is a free-form string so it can read as "25% off for 12 months" or "$5,000 in credits" as appropriate.
- remaining and validUntil are both optional per discount and simply omitted from the row when not set, there's no placeholder text shown in their place.
- The redeem form is a plain HTML form with no client-side state or validation; it submits as a normal GET to "#" by default; wire a real action and onSubmit handler for it to actually validate and apply a code.
- showRedeemForm lets you drop the code-entry UI entirely for read-only contexts like an admin view of a customer's account.
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.