Staaarter

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.

By Staaarter Team
Billing
Updated June 30, 2026
Docs
Live preview

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

Prefer 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

PropTypeDefaultDescription
headingstring"Partner discounts"Panel heading.
descriptionstringnoneOptional line under the heading.
discountsPartnerDiscount[]noneApplied discounts rendered as a list, in the order given.
showRedeemFormbooleantrueWhether the "have a code?" input and button render below the list.
redeemLabelstring"Have a partner code?"Label above the redeem input.
redeemPlaceholderstring"Enter code"Placeholder text for the redeem input.
redeemButtonLabelstring"Apply"Label for the redeem form's submit button.
classNamestringnoneExtra 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