Billing Screens
Plans, the current subscription, usage, invoices, a wallet and a paywall, ready to compose into a billing page.
Current planPro
ActiveWeb
Wallet
₹2,500
Usage
- Projects41 / 50
- Seats4 / 10
- Api calls9,400 / 10,000
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-uiUsage
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
ActiveWeb
Wallet
₹2,500
Usage
- Projects41 / 50
- Seats4 / 10
- Api calls9,400 / 10,000
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
ActiveWeb
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
- Seats4 / 10
- Api calls9,400 / 10,000
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
| Prop | Type | Default | Description |
|---|---|---|---|
plans | readonly BillingPlan[] | — | Plans to show. Build them with plansFromEntitlements. |
subscription | BillingSubscription | — | Pass ent.resolve(subject) as it is. |
usage | readonly BillingUsage[] | — | One meter per limit. |
invoices | readonly BillingInvoice[] | — | Invoices, newest first. |
wallet | { balance: number; currency: string; onTopUp?: () => void } | — | Shows a wallet card. |
source | BillingSource | "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. |
labels | Partial<BillingLabels> | — | Every string, in English by default. Spread DEFAULT_BILLING_LABELS to translate. |
classNames | Partial<Record<"current" | "usage" | "wallet" | "plans" | "invoices", string>> | — | Classes per part. |
PlanPicker
| Prop | Type | Default | Description |
|---|---|---|---|
plans | readonly BillingPlan[] | — | Plan cards: key, name, description, features, limits, prices, badge, sources. |
value | string | — | Selected plan key (controlled). |
defaultValue | string | — | Initial plan key. |
onValueChange | (plan: string) => void | — | Called when the selection changes. |
interval | "month" | "year" | "once" | — | Billing interval (controlled). |
defaultInterval | BillingInterval | — | Initial interval. |
onIntervalChange | (interval: BillingInterval) => void | — | Called when the interval changes. |
currentPlan | string | — | The subscriber's plan key: marked, and its button is disabled. |
source | BillingSource | "web" | Where this purchase happens. Plans not sold there are hidden. |
onSubscribe | (plan: BillingPlan, interval: BillingInterval) => unknown | — | A returned Promise keeps the button pending. |
labels | Partial<BillingLabels> | — | Every string, in English by default. Spread DEFAULT_BILLING_LABELS to translate. |
classNames | Partial<Record<"intervals" | "plans" | "plan" | "price" | "features" | "cta", string>> | — | Classes per part. |
CurrentPlanCard
| Prop | Type | Default | Description |
|---|---|---|---|
subscription | BillingSubscription | — | plan, status, currentPeriodEnd, graceUntil, source. |
plans | readonly 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. |
source | BillingSource | — | Where the app runs. A store here shows Restore even without a subscription. |
labels | Partial<BillingLabels> | — | Every string, in English by default. Spread DEFAULT_BILLING_LABELS to translate. |
UsageMeters
| Prop | Type | Default | Description |
|---|---|---|---|
usage | readonly BillingUsage[] | — | One bar per limit; amber at 75%, red at 90%. |
labels | Partial<BillingLabels> | — | Every string, in English by default. Spread DEFAULT_BILLING_LABELS to translate. |
InvoiceList
| Prop | Type | Default | Description |
|---|---|---|---|
invoices | readonly BillingInvoice[] | — | Each opens its GST HTML invoice in a new tab. |
labels | Partial<BillingLabels> | — | Every string, in English by default. Spread DEFAULT_BILLING_LABELS to translate. |
WalletCard
| Prop | Type | Default | Description |
|---|---|---|---|
balance | number | — | In minor units. |
currency | string | — | ISO 4217 code. |
onTopUp | () => void | — | Shows a top-up button. |
labels | Partial<BillingLabels> | — | Every string, in English by default. Spread DEFAULT_BILLING_LABELS to translate. |
Paywall
| Prop | Type | Default | Description |
|---|---|---|---|
title | ReactNode | labels.paywallTitle | Headline. |
subtitle | ReactNode | labels.paywallSubtitle | Text under the headline. |
onRestore | () => Promise<unknown> | unknown | — | In a store build (source is appstore or googleplay), shows Restore. |
...PlanPickerProps | PlanPickerProps | — | Every PlanPicker prop is passed through. |
RestorePurchasesButton
| Prop | Type | Default | Description |
|---|---|---|---|
onRestore | () => Promise<unknown> | unknown | — | Ask the store and re-apply purchases. Resolve false when nothing was found. |
labels | Partial<BillingLabels> | — | Every string, in English by default. Spread DEFAULT_BILLING_LABELS to translate. |