Skip to main content
Version: 1.0.3

Billing Page

A comprehensive Billing management page that allows users to view and manage their subscription, payment methods, and billing history. It includes current plan details with renewal information, usage overview metrics, and a full invoice history with actions for viewing, downloading, or deleting invoices.

Billing & Subscription

Manage your plan, payment methods, and billing history.

Standard Plan

Active

You are currently on the Standard plan.

$19.99
per month
  • Storage 20GB
  • Databases 20
  • License
  • Email Accounts

Next Billing Date

March 21, 2025

Usage Details

Your resource consumption this billing cycle.

API Calls41,000 / 50,000
Active Seats8 / 10
Storage (GB)45 / 100 GB

PRICING

Plan & Pricing with your growth

Choose the plan that fits your needs. You can upgrade or downgrade at any time.

Starter

Perfect for getting started

$FREE /mo
  • Disk Space 128 GB
  • Bandwidth 15 GB
  • Databases 1
  • ×License
MOST POPULAR

Standard

For growing teams

$19.99 /mo
  • Storage 20GB
  • Databases 20
  • License
  • Email Accounts

Enterprise

For organizations

$29.99 /mo
  • Storage 50GB
  • Databases 50
  • License
  • Email Accounts

Payment Method

Your current payment details.

VISA •••• •••• •••• 4242

Expires 12/26

Danger Zone

Permanently cancel your subscription. This action takes effect at the end of your current billing cycle.

Billing History

View and download your past invoices.

DateAmountStatusInvoice
Jan 21, 2025$21Pending
Dec 21, 2024$22Paid
Dec 21, 2024$23Failed

Page 1 of 2

Installation

ignix add component billingPage

Usage

import { useState, useCallback } from "react"
import {
FaCcVisa,
FaCcMastercard,
FaCcAmex,
FaCcPaypal,
} from "react-icons/fa"
import { Gem, Crown, X } from "lucide-react"
import { BillingPage } from "@ignix-ui/billing-page"
import { Button } from "@src/components/button"
import { Card } from "@src/components/card"
import { Typography } from "@src/components/typography"

/* ----------------------------------
* Static Data
* ---------------------------------- */

const AVAILABLE_PAYMENT_METHODS = [
{ id: "visa", label: "Visa", icon: FaCcVisa },
{ id: "mastercard", label: "Mastercard", icon: FaCcMastercard },
{ id: "amex", label: "American Express", icon: FaCcAmex },
{ id: "paypal", label: "PayPal", icon: FaCcPaypal },
]

const FEATURES = [
{ id: 1, label: "Components" },
{ id: 2, label: "Theme" },
{ id: 3, label: "Support" },
{ id: 4, label: "API Access" },
{ id: 5, label: "Customisation" },
{ id: 6, label: "SLA" },
]

const PLANS = [
{
id: 1,
name: "Basic",
price: "$199/month",
icon: Home,
featureMap: {
1: true,
2: false,
3: "Email",
4: false,
5: "Limited",
6: null,
},
},
{
id: 2,
name: "Standard",
price: "$399/month",
icon: Settings2,
recommended: true,
featureMap: {
1: true,
2: true,
3: "Chat",
4: true,
5: "Full",
6: "24h",
},
},
{
id: 3,
name: "Premium",
price: "$899/month",
icon: Proportions,
recommended: true,
featureMap: {
1: true,
2: true,
3: "24/7 Priority",
4: true,
5: "Unlimited",
6: "4h",
},
},
]

const INVOICES = [
{ id: "1", plan: "Pro Annual", date: "Jan 21, 2025", amount: "$21", status: "Pending" },
{ id: "2", plan: "Pro Annual", date: "Dec 21, 2024", amount: "$22", status: "Paid" },
{ id: "3", plan: "Pro Annual", date: "Dec 21, 2024", amount: "$23", status: "Failed" },
]

/* ----------------------------------
* Component
* ---------------------------------- */

export default function BillingDemo() {
const [isPaymentModalOpen, setPaymentModalOpen] = useState(false)

/* ----------------------------------
* Handlers (defined as const)
* ---------------------------------- */

const handleInvoiceDownload = useCallback((invoice) => {
//write your logic here
}, [])

const handleCancelSubscription = useCallback(() => {
//write your logic here
}, [])

const handleUpdatePaymentMethod = useCallback(() => {
setPaymentModalOpen(true)
}, [])

const handleSelectPaymentMethod = useCallback((methodId: string) => {
//write your logic here
setPaymentModalOpen(false)
}, [])

/* ----------------------------------
* Render
* ---------------------------------- */

return (
<BillingPage
/* ---- Plan & Billing ---- */
animation="fadeIn"
renewalDate={new Date("2025-03-21")}
currentPlanId={2}
subscriptionStatus="active"
billingCycle="monthly"
plans={PLANS}
features={FEATURES}
invoices={INVOICES}

/* ---- Usage Meters ---- */
apiUsage={{ label: "API Calls", used: 41000, total: 50000 }}
storageUsage={{ label: "Storage", used: 45, total: 100, unit: "GB" }}
seatsUsage={{ label: "Active Seats", used: 8, total: 10 }}

/* ---- Invoice Actions ---- */
onInvoiceDownload={handleInvoiceDownload}

/* ---- Subscription ---- */
onCancelSubscription={handleCancelSubscription}

/* ---- Payment Card ---- */
card={{
brand: FaCcVisa,
cardNumber: "4242424242424242",
expiryMonth: "12",
expiryYear: "26",
cardHolderName: "John Doe",
}}
onUpdatePaymentMethod={handleUpdatePaymentMethod}

/* ---- Custom Payment Method Modal ---- */
renderUpdatePaymentMethod={() =>
isPaymentModalOpen ? (
<div
className="fixed inset-0 z-50 flex items-center justify-center bg-black/60"
onClick={() => setPaymentModalOpen(false)}
>
<Card
className="w-full max-w-md p-6"
onClick={(e) => e.stopPropagation()}
>
<div className="flex items-center justify-between mb-4">
<Typography variant="h6">Select Payment Method</Typography>
<Button
size="icon"
variant="ghost"
onClick={() => setPaymentModalOpen(false)}
>
<X className="w-4 h-4" />
</Button>
</div>

<div className="space-y-3">
{AVAILABLE_PAYMENT_METHODS.map((method) => {
const Icon = method.icon
return (
<button
key={method.id}
className="w-full flex items-center gap-4 rounded-lg border p-3 hover:bg-muted transition"
onClick={() => handleSelectPaymentMethod(method.id)}
>
<Icon className="w-8 h-8" />
<span className="font-medium">{method.label}</span>
</button>
)
})}
</div>

<Typography variant="body-small" className="mt-4 text-zinc-500">
Demo selector only. No real payment data is collected.
</Typography>
</Card>
</div>
) : null
}
/>
)
}

props

Core Configuration

PropTypeDefaultDescription
headerTitlestring"OpenSrc"Title displayed in the billing page header.
headerIconLucideIconBuilding2Icon shown next to the header title.

Plans & Pricing

PropTypeDefaultDescription
plansPlanProps[][]Available subscription plans displayed in the pricing grid.
featuresFeature[][]List of features available across plans.
currentPlanIdnumber0ID of the currently active plan.
renewalDateDateNext billing or renewal date for the active plan.
subscriptionStatus"active" | "trial" | "canceled" | "past_due" | "expired" | "pending""active"Current subscription status.
billingCycle"monthly" | "yearly""monthly"Billing cycle for the current plan.
showcurrentPlanIdbooleantrueToggles visibility of the active plan card.
showPricingbooleanfalseForces the pricing grid to be visible.
isLoadingbooleanfalseShows skeleton loaders instead of content.

Usage Overview

PropTypeDefaultDescription
showUsageOverviewbooleantrueControls visibility of the usage overview card.
apiUsageUsageMetricAPI usage metric with used and total values.
storageUsageUsageMetricStorage consumption metric with circular progress indicator.
seatsUsageUsageMetricSeat allocation and usage metric.

Payment Method

PropTypeDefaultDescription
cardCardDetailsActive payment card details (brand, masked number, expiry).
onUpdatePaymentMethod() => voidTriggered when the user clicks Update Payment Method.
onCancelSubscription() => voidFired after confirming subscription cancellation.
onSubscriptionCancelled() => voidCalled after subscription is successfully cancelled.
renderUpdatePaymentMethod() => ReactNodeOptional render slot for a custom payment update modal or flow.

Billing History

PropTypeDefaultDescription
showBillingTablebooleantrueToggles the billing history table.
invoicesInvoice[][]List of billing invoices displayed in the table.
onInvoiceDownload(invoice: Invoice) => voidCalled when an invoice is downloaded.

Animation

PropTypeDefaultDescription
animation"none" | "fadeIn" | "slideUp" | "scaleIn" | "flipIn" | "bounceIn" | "floatIn""fadeIn"Page-wide and card-level animation style.

PlanProps

PropTypeDescription
idnumberUnique identifier for the plan.
namestringPlan display name.
iconLucideIconOptional icon shown with the plan.
pricestringPrice label displayed to the user (e.g., "$199/month").
featureMapRecord<number, FeatureValue>Map of feature IDs to their values (boolean, string, number, or null).
ctaLabelstringCustom label for the call-to-action button.
recommendedbooleanWhether this plan is recommended.

UsageMetric

PropTypeDescription
labelstringMetric label (e.g., API Requests).
usednumberAmount used in the current cycle.
totalnumberTotal available quota.
unitstringUnit label (e.g., GB, requests).