{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "pricing-card", "title": "Pricing Card", "description": "A focused pricing card layout with clear hierarchy.", "dependencies": [ "motion", "@hugeicons/core-free-icons", "@hugeicons/react", "lucide-react", "@number-flow/react", "clsx", "tailwind-merge" ], "files": [ { "path": "registry/default/example/pricing-card.tsx", "content": "\"use client\";\r\n\r\nimport {\r\n Add01Icon,\r\n MinusPlus01Icon,\r\n MinusSignIcon,\r\n Tick02Icon,\r\n UserGroupIcon,\r\n UserStoryIcon,\r\n} from \"@hugeicons/core-free-icons\";\r\nimport { HugeiconsIcon } from \"@hugeicons/react\";\r\nimport NumberFlow from \"@number-flow/react\";\r\nimport { AnimatePresence, motion, LayoutGroup } from \"motion/react\";\r\nimport { useState } from \"react\";\r\n\r\n// Change Here\r\nconst plans = [\r\n {\r\n id: \"plus\",\r\n name: \"Plus\",\r\n description: \"solo\",\r\n monthlyPrice: 8.99,\r\n yearlyPrice: 6.99,\r\n features: [\r\n \"1TB of Space\",\r\n \"30 days of file recovery\",\r\n \"256-bit AES and SSL/TLS\",\r\n ],\r\n },\r\n {\r\n id: \"standard\",\r\n name: \"Standard\",\r\n description: \"startup\",\r\n monthlyPrice: 12.99,\r\n yearlyPrice: 9.99,\r\n features: [\r\n \"1TB of Space\",\r\n \"30 days of file recovery\",\r\n \"256-bit AES and SSL/TLS\",\r\n ],\r\n },\r\n {\r\n id: \"advanced\",\r\n name: \"Advanced\",\r\n description: \"teams\",\r\n monthlyPrice: 24.99,\r\n yearlyPrice: 19.99,\r\n features: [\r\n \"1TB of Space\",\r\n \"30 days of file recovery\",\r\n \"256-bit AES and SSL/TLS\",\r\n ],\r\n },\r\n];\r\n\r\nconst TRANSITION = {\r\n type: \"spring\" as const,\r\n stiffness: 300,\r\n damping: 30,\r\n mass: 0.8,\r\n};\r\n\r\nfunction PricingCard() {\r\n const [billingCycle, setBillingCycle] = useState<\"monthly\" | \"yearly\">(\r\n \"monthly\"\r\n );\r\n const [selectedPlan, setSelectedPlan] = useState(\"standard\");\r\n const [userCount, setUserCount] = useState(3);\r\n\r\n return (\r\n
\r\n
\r\n

\r\n Select a Plan\r\n

\r\n\r\n
\r\n setBillingCycle(\"monthly\")}\r\n className={`flex-1 h-full rounded-lg text-base font-medium relative transition-colors duration-300 ${\r\n billingCycle === \"monthly\"\r\n ? \"text-foreground\"\r\n : \"text-muted-foreground hover:text-foreground\"\r\n }`}\r\n >\r\n {billingCycle === \"monthly\" && (\r\n \r\n )}\r\n Monthly\r\n \r\n setBillingCycle(\"yearly\")}\r\n className={`flex-1 h-full rounded-lg text-base font-medium relative transition-colors duration-300 flex items-center justify-center gap-2 ${\r\n billingCycle === \"yearly\"\r\n ? \"text-foreground\"\r\n : \"text-muted-foreground hover:text-foreground\"\r\n }`}\r\n >\r\n {billingCycle === \"yearly\" && (\r\n \r\n )}\r\n Yearly\r\n \r\n 20% OFF\r\n \r\n \r\n
\r\n
\r\n\r\n
\r\n {plans.map((plan) => {\r\n const isSelected = selectedPlan === plan.id;\r\n const price =\r\n billingCycle === \"monthly\" ? plan.monthlyPrice : plan.yearlyPrice;\r\n\r\n return (\r\n setSelectedPlan(plan.id)}\r\n className=\"relative cursor-pointer\"\r\n >\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n {isSelected && (\r\n \r\n )}\r\n \r\n
\r\n
\r\n
\r\n

\r\n {plan.name}\r\n

\r\n

\r\n {plan.description}\r\n

\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n {billingCycle === \"monthly\" ? \"Month\" : \"Year\"}\r\n
\r\n
\r\n
\r\n\r\n \r\n {isSelected && (\r\n \r\n
\r\n
\r\n {plan.features.map((feature, idx) => (\r\n \r\n \r\n {feature}\r\n \r\n ))}\r\n
\r\n\r\n
\r\n\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n Users\r\n \r\n \r\n Starting at {userCount} users\r\n \r\n
\r\n
\r\n\r\n
\r\n {\r\n e.stopPropagation();\r\n setUserCount(Math.max(1, userCount - 1));\r\n }}\r\n className=\"p-1.5 rounded-lg hover:bg-background hover:shadow-sm transition-all text-muted-foreground/60 hover:text-foreground active:scale-95\"\r\n >\r\n \r\n \r\n \r\n \r\n \r\n {\r\n e.stopPropagation();\r\n setUserCount(userCount + 1);\r\n }}\r\n className=\"p-1.5 rounded-lg hover:bg-background hover:shadow-sm transition-all text-muted-foreground/60 hover:text-foreground active:scale-95\"\r\n >\r\n \r\n \r\n
\r\n
\r\n
\r\n \r\n )}\r\n \r\n
\r\n
\r\n
\r\n );\r\n })}\r\n \r\n \r\n );\r\n}\r\n\r\nexport default PricingCard;\r\n", "type": "registry:component" } ], "type": "registry:component" }