Skip to main content
Clever Ops

Usage Pricing Slider

Usage-based pricing with an honest slider, an arrow-key accessible role=slider sets seats or volume, the price recalculates with rolling digits, and breakpoints are labelled in mono under the track.

Preview & code

Loading Usage Pricing Slider preview

Installation

pnpm dlx shadcn@latest add @cleverui/pricing-slider-usage

Requires the @cleverui registry in your components.json, a one-off, two-line setup.

Usage

tsx
import { PricingSliderUsage } from '@/components/blocks/pricing-slider-usage'
Exampletsx
import { PricingSliderUsage } from '@/components/blocks/pricing-slider-usage'

export default function PricingSliderUsageDemo() {
  return (
    <PricingSliderUsage
      eyebrow="Pricing"
      heading="Pay for what you run"
      unitLabel="seats"
      min={5}
      max={500}
      step={5}
      defaultValue={25}
      bands={[
        { upTo: 50, perUnit: 9 },
        { upTo: 250, perUnit: 7 },
        { upTo: 500, perUnit: 5 },
      ]}
      currency="$"
      billingNote="per month, billed monthly"
      cta={{ label: 'Start with these seats', href: '#' }}
    />
  )
}

API reference

PricingSliderUsage accepts the following props.

PropTypeDefaultDescription
eyebrowstring'Pricing'
headingstring'Pay for what you run'
unitLabelstring'seats'
minnumber5
maxnumber500
stepnumber5
defaultValuenumber25
bands*PricingUsageBand[]marginal price bands in ascending order; last upTo should equal max
currencystring'$'
billingNotestring'per month, billed monthly'
cta{ label: string; href: string }

…plus everything from React.HTMLAttributes<HTMLElement>: className, event handlers, aria attributes and the rest pass straight through.

Referenced types

Typestsx
export interface PricingUsageBand {
  /** inclusive upper bound of this marginal band */
  upTo: number
  perUnit: number
  label?: string
}

Frequently asked questions

How do I install the Usage Pricing Slider component?

Register the @cleverui registry in your components.json ("@cleverui": "https://cleverops.com.au/r/{name}.json"), then run `npx shadcn@latest add @cleverui/pricing-slider-usage`. The shadcn CLI copies the source into your project, you own the code from that point. You can also copy the source directly from this page.

What dependencies does Usage Pricing Slider require?

Usage Pricing Slider uses motion on top of React and Tailwind CSS. You don't need to install it manually, the shadcn CLI resolves and installs npm dependencies automatically when you add the component.

Can I theme Usage Pricing Slider to match my brand?

Yes. The component is styled entirely with Tailwind utilities over standard design tokens (primary, background, muted, border), so it inherits your existing shadcn/ui theme automatically. Change your CSS variables and the component follows, no source edits needed for palette, radius, or fonts.

Want this built for you?

CleverUI is built by the Clever Ops web team. If you'd rather ship a hand-coded, fast, custom website than assemble one, we build them for Australian businesses every week.

Explore web development services