Plan Card
billui/plan-cardFreeComponent
A card for displaying pricing tiers and subscription plans.
Live preview
live · rendered by the registry
Rendered by billui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://billui.com/r/plan-card.jsonSource
1import { cva, type VariantProps } from "class-variance-authority";2import { Check, X } from "lucide-react";3import * as React from "react";4import { Badge } from "@/components/ui/badge";5import { Button } from "@/components/ui/button";6import { cn } from "@/lib/utils";78const planCardVariants = cva(9 "relative rounded-2xl border bg-card text-card-foreground transition-all duration-200",10 {11 variants: {12 variant: {13 default: "border-border",14 highlighted:15 "border-primary shadow-lg shadow-primary/10 ring-1 ring-primary",16 compact: "border-border p-4",17 },18 size: {19 default: "p-6",20 lg: "p-8",21 },22 layout: {23 vertical: "flex flex-col min-w-[280px]",24 horizontal: "flex flex-row items-center gap-6 w-full",25 },26 },27 defaultVariants: {28 variant: "default",29 size: "default",30 layout: "vertical",31 },32 },33);3435interface PlanCardProps36 extends React.HTMLAttributes<HTMLDivElement>,37 VariantProps<typeof planCardVariants> {}3839const PlanCard = React.forwardRef<HTMLDivElement, PlanCardProps>(40 ({ className, variant, size, layout, ...props }, ref) => (41 <div42 ref={ref}43 className={cn(planCardVariants({ variant, size, layout, className }))}44 {...props}45 />46 ),47);48PlanCard.displayName = "PlanCard";4950const PlanCardHeader = React.forwardRef<51 HTMLDivElement,52 React.HTMLAttributes<HTMLDivElement>53>(({ className, ...props }, ref) => (54 <div ref={ref} className={cn("flex flex-col gap-2", className)} {...props} />55));56PlanCardHeader.displayName = "PlanCardHeader";5758interface PlanCardBadgeProps59 extends React.ComponentPropsWithoutRef<typeof Badge> {}6061const PlanCardBadge = React.forwardRef<HTMLDivElement, PlanCardBadgeProps>(62 ({ className, ...props }, ref) => (63 <Badge ref={ref} className={cn("w-fit", className)} {...props} />64 ),65);66PlanCardBadge.displayName = "PlanCardBadge";6768const PlanCardTitle = React.forwardRef<69 HTMLHeadingElement,70 React.HTMLAttributes<HTMLHeadingElement>71>(({ className, ...props }, ref) => (72 <h373 ref={ref}74 className={cn("text-2xl font-bold tracking-tight", className)}75 {...props}76 />77));78PlanCardTitle.displayName = "PlanCardTitle";7980const PlanCardDescription = React.forwardRef<81 HTMLParagraphElement,82 React.HTMLAttributes<HTMLParagraphElement>83>(({ className, ...props }, ref) => (84 <p85 ref={ref}86 className={cn("text-sm text-muted-foreground", className)}87 {...props}88 />89));90// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from billui
All 13 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Animated Usage Cardanimated-usage-card | billui | Components | Free | 2 deps | |
| Billing Addressbilling-address | billui | Components | Free | no deps | |
| Card Iconscard-icons | billui | Components | Free | 1 dep | |
| Card Inputcard-input | billui | Components | Free | no deps | |
| Invoice Cardinvoice-card | billui | Components | Free | 2 deps | |
| Payment Methodpayment-method | billui | Components | Free | 2 deps | |
| Plan Groupplan-group | billui | Components | Free | 1 dep | |
| Pricing Tablepricing-table | billui | Components | Free | 2 deps |
