āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā š shadcn/directory/dodopayments/billingsdk/components/update-plan/update-plan-card ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
<Tabs items={['Preview', 'Code']} className="bg-transparent border-none"> <Tab value="Preview" className="border-none bg-transparent p-0 mt-3"> <PreviewComponents registryName="update-plan-card"> <UpdatePlanCardDemo /> </PreviewComponents> </Tab>
<Tab value="Code" className="mt-3"> <include cwd lang="tsx" meta='title="src/components/update-plan-card-demo.tsx"'>src/components/update-plan-card-demo.tsx</include> </Tab> </Tabs><Tabs items={['shadcn', 'billingSDK']} defaultValue="shadcn" className="bg-transparent border-none">
<Tab value="shadcn" className="border-none bg-transparent p-0 mt-3">
<Tabs items={['npx', 'pnpm', 'yarn', 'bun']} defaultValue="npx" groupId="installation-tabs">
<Tab value="npx">
bash npx shadcn@latest add @billingsdk/update-plan-card
</Tab>
<Tab value="pnpm">
bash pnpm dlx shadcn@latest add @billingsdk/update-plan-card
</Tab>
<Tab value="yarn">
bash yarn dlx shadcn@latest add @billingsdk/update-plan-card
</Tab>
<Tab value="bun">
bash bunx shadcn@latest add @billingsdk/update-plan-card
</Tab>
</Tabs>
</Tab>
<Tab value="billingSDK" className="border-none bg-transparent p-0 mt-3">
<Tabs items={['npx', 'pnpm', 'yarn', 'bun']} defaultValue="npx" groupId="billingsdk-cli-tabs">
<Tab value="npx">
bash npx @billingsdk/cli add update-plan-card
</Tab>
<Tab value="pnpm">
bash pnpm dlx @billingsdk/cli add update-plan-card
</Tab>
<Tab value="yarn">
bash yarn dlx @billingsdk/cli add update-plan-card
</Tab>
<Tab value="bun">
bash bunx @billingsdk/cli add update-plan-card
</Tab>
</Tabs>
</Tab>
</Tabs>
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"
/>
| Prop | Type | Required | Description |
|------|------|----------|-------------|
| currentPlan | Plan | ā
| The user's current plan object |
| plans | Plan[] | ā
| Array of available plans to choose from |
| onPlanChange | (planId: string) => void | ā
| Callback function when a plan is selected |
| className | string | ā | Additional CSS classes for styling |
| title | string | ā | Custom title for the card (default: "Upgrade Plan") |
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.
<include cwd lang="tsx" meta='title="src/components/update-plan-card-demo.tsx"'>src/components/update-plan-card-demo.tsx</include>
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā