Staaarter

Billing Commission Rate Override

An admin panel block for overriding a partner's commission rate. A toggle switches between the standard tier rate and a custom override, a number input takes the new rate with min/max validation, and an effective-rate preview updates as the admin types. A save action moves through a saving and saved state. Built for partner and affiliate admin dashboards.

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

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button, input, label dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/billing-commission-rate-override.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/billing/billing35.tsx instead.

Usage

The file also exports billing35Demo, 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 { Billing35, billing35Demo } from "@/components/blocks/billing/billing35";

export default function Page() {
  return <Billing35 {...billing35Demo} />;
}

Props

PropTypeDefaultDescription
partnerNamestring"Partner"Name shown under the heading.
partnerTierstringnoneOptional tier label shown next to the partner name, such as "Gold partner".
standardRatenumbernoneThe partner's default commission rate as a percentage, e.g. 15 for 15%.
defaultOverrideEnabledbooleanfalseWhether the custom-override mode is active on first render.
defaultOverrideRatenumberstandardRateStarting value for the override input when override mode is on.
minRatenumber0Minimum accepted override rate.
maxRatenumber50Maximum accepted override rate.
saveLabelstring"Save override"Label for the save button in its idle state.
savingLabelstring"Saving"Label shown while the save action is in its loading state.
savedLabelstring"Saved"Label shown after a successful save.
classNamestringnoneExtra classes for the outer container.

Behavior notes

  • Rate mode (standard or custom) and the override value are both local state; the effective-rate display in the header recalculates on every keystroke in the override input.
  • The override input is only rendered when custom mode is selected; switching back to standard hides it and the effective rate falls back to standardRate.
  • A rate outside the minRate/maxRate range marks the input aria-invalid and shows an inline error, and disables the Save button until it's corrected.
  • Save moves through a 700ms saving state (spinner, disabled) before showing a saved state with a check icon; changing the mode or the rate value afterward resets the button back to idle.
  • The delta line next to the input (e.g. "+7.5% vs. standard") only appears once the entered rate is valid and differs from the standard rate.
  • Saving doesn't persist anything on its own; it's a local UI state stand-in for a real save request.

Frequently asked questions