Skip to Content

Billing Screens

Plans, the current subscription, usage, invoices, a wallet and a paywall, ready to compose into a billing page.

Current planPro
Active
Web

Wallet

₹2,500

Usage

  • Projects41 / 50
    x
  • Seats4 / 10
    x
  • Api calls9,400 / 10,000
    x

Plans

Plans

Invoices

import { type BillingInvoice, type BillingPlan, BillingScreen, type BillingSubscription, type BillingUsage } from "@dapplelight/signet-ui/screens/billing-screens"

const invoices: BillingInvoice[] = [
  { id: "i3", number: "INV-2026-0003", date: new Date(Date.now() - 5 * 86400_000), total: 49900, currency: "INR", status: "paid", href: "#" },
  { id: "i2", number: "INV-2026-0002", date: new Date(Date.now() - 35 * 86400_000), total: 49900, currency: "INR", status: "paid", href: "#" },
  { id: "i1", number: "INV-2026-0001", date: new Date(Date.now() - 65 * 86400_000), total: 49900, currency: "INR", status: "refunded", href: "#" },
]

const usage: BillingUsage[] = [
  { key: "projects", period: "total", used: 41, limit: 50, remaining: 9 },
  { key: "seats", period: "total", used: 4, limit: 10, remaining: 6 },
  { key: "api_calls", period: "month", used: 9400, limit: 10000, remaining: 600 },
]

const subscription: BillingSubscription = {
  plan: "pro",
  status: "active",
  currentPeriodEnd: new Date(Date.now() + 18 * 86400_000),
  source: { gateway: "web" },
}

const plans: BillingPlan[] = [
  {
    key: "free",
    name: "Free",
    description: "For trying things out",
    features: ["basic_reports"],
    limits: { projects: 3 },
    prices: { month: { amount: 0, currency: "INR" } },
  },
  {
    key: "pro",
    name: "Pro",
    description: "For growing teams",
    badge: "Popular",
    features: ["basic_reports", "priority_support"],
    limits: { projects: 50, seats: 10 },
    prices: { month: { amount: 49900, currency: "INR" }, year: { amount: 499000, currency: "INR" } },
  },
  {
    key: "business",
    name: "Business",
    description: "For the whole company",
    features: ["basic_reports", "priority_support", "sso"],
    limits: { projects: null, seats: null },
    prices: { month: { amount: 149900, currency: "INR" }, year: { amount: 1499000, currency: "INR" } },
  },
]

const wait = (ms: number) => new Promise((r) => setTimeout(r, ms))

export function BillingScreenDemo() {
  return (
    <div className="w-full">
      <BillingScreen
        plans={plans}
        subscription={subscription}
        usage={usage}
        invoices={invoices}
        wallet={{ balance: 250000, currency: "INR", onTopUp: () => undefined }}
        onSubscribe={() => wait(800)}
        onManage={() => undefined}
      />
    </div>
  )
}

Installation

npm i @dapplelight/signet-ui

Usage

import { BillingScreen, PlanPicker, CurrentPlanCard, UsageMeters, InvoiceList, WalletCard, Paywall, RestorePurchasesButton } from "@dapplelight/signet-ui/screens/billing-screens"
import { plans, subscription, usage, invoices, checkout } from "./billing"

<BillingScreen plans={plans} subscription={subscription} usage={usage} invoices={invoices} onSubscribe={checkout} />

plansFromEntitlements(plans, display) builds the plan list from a definePlans object, and formatMoney(amount, currency) formats minor units.

Examples

BillingScreen

Current planPro
Active
Web

Wallet

₹2,500

Usage

  • Projects41 / 50
    x
  • Seats4 / 10
    x
  • Api calls9,400 / 10,000
    x

Plans

Plans

Invoices

import { type BillingInvoice, type BillingPlan, BillingScreen, type BillingSubscription, type BillingUsage } from "@dapplelight/signet-ui/screens/billing-screens"

const invoices: BillingInvoice[] = [
  { id: "i3", number: "INV-2026-0003", date: new Date(Date.now() - 5 * 86400_000), total: 49900, currency: "INR", status: "paid", href: "#" },
  { id: "i2", number: "INV-2026-0002", date: new Date(Date.now() - 35 * 86400_000), total: 49900, currency: "INR", status: "paid", href: "#" },
  { id: "i1", number: "INV-2026-0001", date: new Date(Date.now() - 65 * 86400_000), total: 49900, currency: "INR", status: "refunded", href: "#" },
]

const usage: BillingUsage[] = [
  { key: "projects", period: "total", used: 41, limit: 50, remaining: 9 },
  { key: "seats", period: "total", used: 4, limit: 10, remaining: 6 },
  { key: "api_calls", period: "month", used: 9400, limit: 10000, remaining: 600 },
]

const subscription: BillingSubscription = {
  plan: "pro",
  status: "active",
  currentPeriodEnd: new Date(Date.now() + 18 * 86400_000),
  source: { gateway: "web" },
}

const plans: BillingPlan[] = [
  {
    key: "free",
    name: "Free",
    description: "For trying things out",
    features: ["basic_reports"],
    limits: { projects: 3 },
    prices: { month: { amount: 0, currency: "INR" } },
  },
  {
    key: "pro",
    name: "Pro",
    description: "For growing teams",
    badge: "Popular",
    features: ["basic_reports", "priority_support"],
    limits: { projects: 50, seats: 10 },
    prices: { month: { amount: 49900, currency: "INR" }, year: { amount: 499000, currency: "INR" } },
  },
  {
    key: "business",
    name: "Business",
    description: "For the whole company",
    features: ["basic_reports", "priority_support", "sso"],
    limits: { projects: null, seats: null },
    prices: { month: { amount: 149900, currency: "INR" }, year: { amount: 1499000, currency: "INR" } },
  },
]

const wait = (ms: number) => new Promise((r) => setTimeout(r, ms))

export function BillingScreenDemo() {
  return (
    <div className="w-full">
      <BillingScreen
        plans={plans}
        subscription={subscription}
        usage={usage}
        invoices={invoices}
        wallet={{ balance: 250000, currency: "INR", onTopUp: () => undefined }}
        onSubscribe={() => wait(800)}
        onManage={() => undefined}
      />
    </div>
  )
}

PlanPicker

Plans
import { type BillingPlan, PlanPicker } from "@dapplelight/signet-ui/screens/billing-screens"

const plans: BillingPlan[] = [
  {
    key: "free",
    name: "Free",
    description: "For trying things out",
    features: ["basic_reports"],
    limits: { projects: 3 },
    prices: { month: { amount: 0, currency: "INR" } },
  },
  {
    key: "pro",
    name: "Pro",
    description: "For growing teams",
    badge: "Popular",
    features: ["basic_reports", "priority_support"],
    limits: { projects: 50, seats: 10 },
    prices: { month: { amount: 49900, currency: "INR" }, year: { amount: 499000, currency: "INR" } },
  },
  {
    key: "business",
    name: "Business",
    description: "For the whole company",
    features: ["basic_reports", "priority_support", "sso"],
    limits: { projects: null, seats: null },
    prices: { month: { amount: 149900, currency: "INR" }, year: { amount: 1499000, currency: "INR" } },
  },
]

const wait = (ms: number) => new Promise((r) => setTimeout(r, ms))

export function PlanPickerDemo() {
  return (
    <div className="w-full">
      <PlanPicker plans={plans} defaultValue="pro" currentPlan="free" onSubscribe={() => wait(800)} />
    </div>
  )
}

CurrentPlanCard

Current planPro
Active
Web
import { type BillingPlan, type BillingSubscription, CurrentPlanCard } from "@dapplelight/signet-ui/screens/billing-screens"

const subscription: BillingSubscription = {
  plan: "pro",
  status: "active",
  currentPeriodEnd: new Date(Date.now() + 18 * 86400_000),
  source: { gateway: "web" },
}

const plans: BillingPlan[] = [
  {
    key: "free",
    name: "Free",
    description: "For trying things out",
    features: ["basic_reports"],
    limits: { projects: 3 },
    prices: { month: { amount: 0, currency: "INR" } },
  },
  {
    key: "pro",
    name: "Pro",
    description: "For growing teams",
    badge: "Popular",
    features: ["basic_reports", "priority_support"],
    limits: { projects: 50, seats: 10 },
    prices: { month: { amount: 49900, currency: "INR" }, year: { amount: 499000, currency: "INR" } },
  },
  {
    key: "business",
    name: "Business",
    description: "For the whole company",
    features: ["basic_reports", "priority_support", "sso"],
    limits: { projects: null, seats: null },
    prices: { month: { amount: 149900, currency: "INR" }, year: { amount: 1499000, currency: "INR" } },
  },
]

export function CurrentPlanCardDemo() {
  return (
    <div className="w-full max-w-md">
      <CurrentPlanCard subscription={subscription} plans={plans} onManage={() => undefined} />
    </div>
  )
}

UsageMeters

Usage

  • Projects41 / 50
    x
  • Seats4 / 10
    x
  • Api calls9,400 / 10,000
    x
import { type BillingUsage, UsageMeters } from "@dapplelight/signet-ui/screens/billing-screens"

const usage: BillingUsage[] = [
  { key: "projects", period: "total", used: 41, limit: 50, remaining: 9 },
  { key: "seats", period: "total", used: 4, limit: 10, remaining: 6 },
  { key: "api_calls", period: "month", used: 9400, limit: 10000, remaining: 600 },
]

export function UsageMetersDemo() {
  return (
    <div className="w-full max-w-md">
      <UsageMeters usage={usage} />
    </div>
  )
}

InvoiceList

import { type BillingInvoice, InvoiceList } from "@dapplelight/signet-ui/screens/billing-screens"

const invoices: BillingInvoice[] = [
  { id: "i3", number: "INV-2026-0003", date: new Date(Date.now() - 5 * 86400_000), total: 49900, currency: "INR", status: "paid", href: "#" },
  { id: "i2", number: "INV-2026-0002", date: new Date(Date.now() - 35 * 86400_000), total: 49900, currency: "INR", status: "paid", href: "#" },
  { id: "i1", number: "INV-2026-0001", date: new Date(Date.now() - 65 * 86400_000), total: 49900, currency: "INR", status: "refunded", href: "#" },
]

export function InvoiceListDemo() {
  return (
    <div className="w-full max-w-lg">
      <InvoiceList invoices={invoices} />
    </div>
  )
}

WalletCard

Wallet

₹2,500

import { WalletCard } from "@dapplelight/signet-ui/screens/billing-screens"

export function WalletCardDemo() {
  return (
    <div className="w-full max-w-sm">
      <WalletCard balance={250000} currency="INR" onTopUp={() => undefined} />
    </div>
  )
}

Paywall

Go further with Pro

Cancel any time.

Plans
import { type BillingPlan, Paywall } from "@dapplelight/signet-ui/screens/billing-screens"

const plans: BillingPlan[] = [
  {
    key: "free",
    name: "Free",
    description: "For trying things out",
    features: ["basic_reports"],
    limits: { projects: 3 },
    prices: { month: { amount: 0, currency: "INR" } },
  },
  {
    key: "pro",
    name: "Pro",
    description: "For growing teams",
    badge: "Popular",
    features: ["basic_reports", "priority_support"],
    limits: { projects: 50, seats: 10 },
    prices: { month: { amount: 49900, currency: "INR" }, year: { amount: 499000, currency: "INR" } },
  },
  {
    key: "business",
    name: "Business",
    description: "For the whole company",
    features: ["basic_reports", "priority_support", "sso"],
    limits: { projects: null, seats: null },
    prices: { month: { amount: 149900, currency: "INR" }, year: { amount: 1499000, currency: "INR" } },
  },
]

const wait = (ms: number) => new Promise((r) => setTimeout(r, ms))

export function PaywallDemo() {
  return (
    <div className="w-full">
      <Paywall
        title="Go further with Pro"
        subtitle="Cancel any time."
        plans={plans.slice(0, 2)}
        defaultValue="pro"
        onSubscribe={() => wait(800)}
      />
    </div>
  )
}

RestorePurchasesButton

import { RestorePurchasesButton } from "@dapplelight/signet-ui/screens/billing-screens"

const wait = (ms: number) => new Promise((r) => setTimeout(r, ms))

export function RestorePurchasesButtonDemo() {
  return <RestorePurchasesButton onRestore={() => wait(800)} />
}

API Reference

BillingScreen

PropTypeDefaultDescription
plansreadonly BillingPlan[]—Plans to show. Build them with plansFromEntitlements.
subscriptionBillingSubscription—Pass ent.resolve(subject) as it is.
usagereadonly BillingUsage[]—One meter per limit.
invoicesreadonly BillingInvoice[]—Invoices, newest first.
wallet{ balance: number; currency: string; onTopUp?: () => void }—Shows a wallet card.
sourceBillingSource"web"Where the app runs. Plans not sold there are hidden.
onSubscribe(plan: BillingPlan, interval: BillingInterval) => unknown—Start checkout or the store purchase.
onManage() => void—Shows a Manage button.
onRestore() => Promise<unknown> | unknown—Restore store purchases.
labelsPartial<BillingLabels>—Every string, in English by default. Spread DEFAULT_BILLING_LABELS to translate.
classNamesPartial<Record<"current" | "usage" | "wallet" | "plans" | "invoices", string>>—Classes per part.

PlanPicker

PropTypeDefaultDescription
plansreadonly BillingPlan[]—Plan cards: key, name, description, features, limits, prices, badge, sources.
valuestring—Selected plan key (controlled).
defaultValuestring—Initial plan key.
onValueChange(plan: string) => void—Called when the selection changes.
interval"month" | "year" | "once"—Billing interval (controlled).
defaultIntervalBillingInterval—Initial interval.
onIntervalChange(interval: BillingInterval) => void—Called when the interval changes.
currentPlanstring—The subscriber's plan key: marked, and its button is disabled.
sourceBillingSource"web"Where this purchase happens. Plans not sold there are hidden.
onSubscribe(plan: BillingPlan, interval: BillingInterval) => unknown—A returned Promise keeps the button pending.
labelsPartial<BillingLabels>—Every string, in English by default. Spread DEFAULT_BILLING_LABELS to translate.
classNamesPartial<Record<"intervals" | "plans" | "plan" | "price" | "features" | "cta", string>>—Classes per part.

CurrentPlanCard

PropTypeDefaultDescription
subscriptionBillingSubscription—plan, status, currentPeriodEnd, graceUntil, source.
plansreadonly BillingPlan[][]Used to show the plan's name.
onManage() => void—Shows a Manage button.
onRestore() => Promise<unknown> | unknown—Shown when the subscription came from a store.
sourceBillingSource—Where the app runs. A store here shows Restore even without a subscription.
labelsPartial<BillingLabels>—Every string, in English by default. Spread DEFAULT_BILLING_LABELS to translate.

UsageMeters

PropTypeDefaultDescription
usagereadonly BillingUsage[]—One bar per limit; amber at 75%, red at 90%.
labelsPartial<BillingLabels>—Every string, in English by default. Spread DEFAULT_BILLING_LABELS to translate.

InvoiceList

PropTypeDefaultDescription
invoicesreadonly BillingInvoice[]—Each opens its GST HTML invoice in a new tab.
labelsPartial<BillingLabels>—Every string, in English by default. Spread DEFAULT_BILLING_LABELS to translate.

WalletCard

PropTypeDefaultDescription
balancenumber—In minor units.
currencystring—ISO 4217 code.
onTopUp() => void—Shows a top-up button.
labelsPartial<BillingLabels>—Every string, in English by default. Spread DEFAULT_BILLING_LABELS to translate.

Paywall

PropTypeDefaultDescription
titleReactNodelabels.paywallTitleHeadline.
subtitleReactNodelabels.paywallSubtitleText under the headline.
onRestore() => Promise<unknown> | unknown—In a store build (source is appstore or googleplay), shows Restore.
...PlanPickerPropsPlanPickerProps—Every PlanPicker prop is passed through.

RestorePurchasesButton

PropTypeDefaultDescription
onRestore() => Promise<unknown> | unknown—Ask the store and re-apply purchases. Resolve false when nothing was found.
labelsPartial<BillingLabels>—Every string, in English by default. Spread DEFAULT_BILLING_LABELS to translate.