Billing Period Input

Billing Period Input is a copy-paste React component that stops yearly price typed into monthly plan before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/billing-period-input
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsYearly price typed into monthly plan

Was this component page useful?

How do I install Billing Period Input?

pnpm dlx shadcn@latest add @bollard/billing-period-input

The files land in your project. They're yours to edit.

How do I use Billing Period Input in React?

billing-period-input-usage.tsx
import { BillingPeriodInput } from "@/components/ui/billing-period-input"

<BillingPeriodInput
  label="Pro plan price"
  defaultValue={{ amount: "5,988", period: "month" }}
  reference={{ amount: 499, period: "month", label: "the current Pro price" }}
/>

What input mistakes does Billing Period Input catch?

  • A yearly price entered as monthly, or the reverse
  • A team total entered as a per-seat price
  • Large jumps from the reference price (current plan, plan below or last year's)
  • Misreading the rate, by showing it in every period

What props does Billing Period Input accept?

BillingPeriodInput props
PropTypeDefault
label

Visible label.

string"Price"
value

Controlled value.

BillingPriceValue—
defaultValue

Initial value when uncontrolled.

Partial<BillingPriceValue>—
onValueChange

Called with the value and the parsed amount (null while it isn't a number).

(value: BillingPriceValue, amount: number | null) => void—
currency

ISO currency code.

string"INR"
locale

Locale for amounts, e.g. "en-IN" for ₹1,49,900 grouping.

string"en-IN"
periods

Periods offered, shortest first. All of them are read back.

BillingPeriod[]["week", "month", "quarter", "year"]
seats

Seats on the plan. When set, the price can be per seat or a total and the team total is read back.

number—
reference

A known price to compare against, which turns on the slip warnings.

PriceReference—
messages

Override any of the default messages.

Partial<typeof BILLING_PERIOD_MESSAGES>—

* required. Also accepts the native props of <div> (className, aria-*, data-*…), passed through to it.

How is Billing Period Input accessible?

  • Visible <label> tied to the input, described by an aria-live="polite" status
  • Price basis is a role="radiogroup" of role="radio" buttons
  • The period selector has an aria-label
  • Warnings use an icon plus text

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

  • The mix-up checks need a reference price; without one it only reads back
  • Weeks are converted as 12/52 of a month, so readbacks are approximate for weekly plans

What expensive mistakes does Billing Period Input stop?

Yearly price typed into monthly plan

Also known as

pricing · plan · subscription · billing period · monthly yearly · per seat · dodo payments · stripe price

Field type

What dependencies does Billing Period Input require?

Billing Period Input facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameBilling Period Input
Registry identifier@bollard/billing-period-input
Install commandnpx shadcn@latest add @bollard/billing-period-input
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Billing Period Input

How does Billing Period Input prevent financial transaction errors?

Billing Period Input prevents yearly price typed into monthly plan. Blocks A yearly price entered as monthly, or the reverse, A team total entered as a per-seat price, Large jumps from the reference price (current plan, plan below or last year's), Misreading the rate, by showing it in every period before processing. Limitation: apply idempotency keys for billing-period-input.

How do I install billing-period-input with shadcn?

Run `npx shadcn@latest add @bollard/billing-period-input`. Sources added: registry/default/billing-period-input/billing-period-input.tsx, registry/default/billing-period-input/billing-period.ts. Package requirements: lucide-react.

What props customize Billing Period Input?

Billing Period Input accepts `label`, `value`, `defaultValue`, `onValueChange`, `currency`. Configures pricing, plan, subscription behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of billing-period-input?

The mix-up checks need a reference price; without one it only reads back. Weeks are converted as 12/52 of a month, so readbacks are approximate for weekly plans Server requirement: backend verification for billing-period-input.

How does Billing Period Input meet accessibility guidelines?

Visible <label> tied to the input, described by an aria-live="polite" status. Price basis is a role="radiogroup" of role="radio" buttons. The period selector has an aria-label. Warnings use an icon plus text. Minimizes errors: monthly vs yearly price, per seat price wrong.

Which components pair with Billing Period Input?