Billing SDK/Billing SDK
Update PlanUpdate Plan Card

Update Plan Card

The Update Plan Card component provides a compact, card-based interface for users to upgrade or change their subscription plan. It's perfect for embedding in dashboards or sidebars where space is limited.

Upgrade Plan

For developers testing out Liveblocks locally.

Presence
Comments
Notifications
Text Editor
Sync Datastore
$0
/month
Most popular

For companies adding collaboration in production.

Presence
Comments
Notifications
Text Editor
Sync Datastore
$20
/month

For organizations that need more support and compliance features.

Presence
Comments
Notifications
Text Editor
Sync Datastore
Custom
/month
src/components/update-plan-card-demo.tsx
'use client'

import { UpdatePlanCard } from '@/components/billingsdk/update-plan-card';
import { plans } from '@/lib/billingsdk-config';

export function UpdatePlanCardDemo() {

    return (
        <main className="flex flex-1 flex-col justify-center text-center w-full">
            <UpdatePlanCard
                currentPlan={plans[0]}
                plans={plans}
                onPlanChange={(planId) => {
                    console.log("Upgrade plan to", planId)
                }}
            />
        </main>
    );
}

Installation

npx shadcn@latest add @billingsdk/update-plan-card
pnpm dlx shadcn@latest add @billingsdk/update-plan-card
npx shadcn@latest add @billingsdk/update-plan-card
npx @billingsdk/cli add update-plan-card
pnpm dlx @billingsdk/cli add update-plan-card
npx @billingsdk/cli add update-plan-card

Usage

import { UpdatePlanCard } from "@/components/billingsdk/update-plan-card";
import { plans } from "@/lib/billingsdk-config";
<UpdatePlanCard
  currentPlan={plans[0]}
  plans={plans}
  onPlanChange={(planId) => {
    // Handle plan change
    console.log('Plan changed to:', planId);
  }}
  title="Upgrade Your Plan"
/>

Props

PropTypeRequiredDescription
currentPlanPlanThe user's current plan object
plansPlan[]Array of available plans to choose from
onPlanChange(planId: string) => voidCallback function when a plan is selected
classNamestringAdditional CSS classes for styling
titlestringCustom title for the card (default: "Upgrade Plan")

Theming

The update plan card component is styled using the shadcn/ui library. You can customize the colors and fonts by overriding the CSS variables. You can also get the theme from the Theming page.

Example

src/components/update-plan-card-demo.tsx
'use client'

import { UpdatePlanCard } from '@/components/billingsdk/update-plan-card';
import { plans } from '@/lib/billingsdk-config';

export function UpdatePlanCardDemo() {

    return (
        <main className="flex flex-1 flex-col justify-center text-center w-full">
            <UpdatePlanCard
                currentPlan={plans[0]}
                plans={plans}
                onPlanChange={(planId) => {
                    console.log("Upgrade plan to", planId)
                }}
            />
        </main>
    );
}