Staaarter

Billing Resource Scaling UI

An interactive resource scaling block for adjusting a quota like storage or seats with a single slider. The price breakdown and new monthly total recalculate as the slider moves, and an Apply changes button walks through a saving state before confirming the change went through. Built for cloud infrastructure and seat allocation screens where someone needs to see the cost impact before committing to a change.

By Staaarter Team
Billing
Updated July 14, 2026
Docs
Live preview

Docs

Installation

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

npx shadcn add https://staaarter.com/r/billing-resource-scaling-ui.json

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

Usage

The file also exports billing115Demo, 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 { Billing115, billing115Demo } from "@/components/blocks/billing/billing115";

export default function Page() {
  return <Billing115 {...billing115Demo} />;
}

Props

PropTypeDefaultDescription
headingstring"Scale your resources"Heading shown at the top of the card.
descriptionstringnoneOptional supporting text under the heading.
resourceLabelstringnoneLabel for the slider, for example "Storage" or "Team seats".
unitstringnoneUnit shown next to the value, for example "GB" or "seats".
minnumbernoneMinimum slider value.
maxnumbernoneMaximum slider value.
stepnumbernoneSlider step increment.
currentValuenumbernoneThe quantity currently active on the subscription. Sets the slider's starting point and the baseline the delta is measured against.
pricePerUnitnumbernonePrice charged per unit above includedUnits.
includedUnitsnumber0Units covered by the base plan before pricePerUnit starts applying.
basePricenumber0Flat monthly base price shown as its own line in the breakdown.
applyLabelstring"Apply changes"Label on the apply button.
classNamestringnoneExtra classes for the outer card.

Behavior notes

  • The slider value is local state seeded from currentValue; the price breakdown and new monthly total recalculate on every change using useMemo.
  • A delta line under the slider shows how far the new value is from currentValue, for example "+150 GB", and is hidden when the value hasn't changed.
  • The Apply button is disabled until the value actually differs from currentValue, and again while a change is being applied.
  • Clicking Apply moves through an idle to saving to applied sequence with a simulated 800ms delay before showing a checkmark; wire the actual API call in place of the setTimeout.
  • Moving the slider again after applying resets the state back to idle, so the checkmark doesn't linger next to a value that's since changed.

Frequently asked questions