{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "pricing-with-user-scaling", "type": "registry:ui", "title": "Pricing with User Scaling", "description": "A pricing component with user-based scaling and dynamic pricing calculations.", "dependencies": [ "motion", "lucide-react", "clsx" ], "registryDependencies": [ "button", "card", "slider" ], "files": [ { "path": "registry/ruixenui/pricing-with-user-scaling.tsx", "content": "\"use client\";\n\nimport { useState } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { CheckIcon, Minus, Plus } from \"lucide-react\";\nimport { AnimatePresence, motion } from \"motion/react\";\nimport cn from \"clsx\";\n\nexport interface Plan {\n title: string;\n monthlyPrice: number;\n annuallyPrice: number;\n desc: string;\n features: string[];\n buttonText: string;\n}\n\ninterface PricingWithUserScalingProps {\n plans?: Plan[];\n defaultBilling?: \"monthly\" | \"annual\";\n defaultUsers?: number;\n}\n\nexport const DEFAULT_PLANS: Plan[] = [\n {\n title: \"Free\",\n monthlyPrice: 0,\n annuallyPrice: 0,\n desc: \"Perfect to start with personal usage\",\n features: [\n \"20 volts per month\",\n \"Roll over volts\",\n \"Personal use license\",\n \"Public generations\",\n \"Plugins for Figma, Framer, Webflow\",\n ],\n buttonText: \"Get Started\",\n },\n {\n title: \"Basic\",\n monthlyPrice: 8,\n annuallyPrice: Math.round(8 * 12 * 0.8),\n desc: \"For growing teams\",\n features: [\n \"Roll over volts\",\n \"Royalty free commercial license\",\n \"Public generations\",\n \"Plugins for Figma, Framer, Webflow\",\n ],\n buttonText: \"Get Started\",\n },\n {\n title: \"Standard\",\n monthlyPrice: 16,\n annuallyPrice: Math.round(16 * 12 * 0.8),\n desc: \"For professional creators\",\n features: [\n \"Roll over volts\",\n \"Royalty free commercial license\",\n \"Public generations\",\n \"Plugins for Figma, Framer, Webflow\",\n ],\n buttonText: \"Get Started\",\n },\n {\n title: \"Pro\",\n monthlyPrice: 32,\n annuallyPrice: Math.round(32 * 12 * 0.8),\n desc: \"Advanced tools for teams\",\n features: [\n \"Roll over volts\",\n \"Royalty free commercial license\",\n \"Private generations\",\n \"Plugins for Figma, Framer, Webflow\",\n ],\n buttonText: \"Get Started\",\n },\n {\n title: \"Mastermind\",\n monthlyPrice: 64,\n annuallyPrice: Math.round(64 * 12 * 0.8),\n desc: \"All-in-one for enterprises\",\n features: [\n \"Roll over volts\",\n \"Royalty free commercial license\",\n \"Private generations\",\n \"Plugins for Figma, Framer, Webflow\",\n ],\n buttonText: \"Get Started\",\n },\n];\n\nconst PlanCard = ({\n plan,\n billing,\n users,\n}: {\n plan: Plan;\n billing: \"monthly\" | \"annual\";\n users: number;\n}) => {\n const price = billing === \"annual\" ? plan.annuallyPrice : plan.monthlyPrice;\n\n return (\n \n
\n

{plan.title}

\n

\n ${price * users}\n \n /{billing}\n \n

\n

\n {plan.desc}\n

\n
\n\n
\n \n
\n \n \n {billing === \"monthly\"\n ? \"Billed monthly\"\n : \"Billed in one annual payment\"}\n \n \n
\n
\n\n
\n Includes:\n {plan.features.map((feature, idx) => (\n
\n \n {feature}\n
\n ))}\n
\n \n );\n};\n\nexport default function PricingWithUserScaling({\n plans = DEFAULT_PLANS,\n defaultBilling = \"monthly\",\n defaultUsers = 1,\n}: PricingWithUserScalingProps) {\n const [billing, setBilling] = useState<\"monthly\" | \"annual\">(defaultBilling);\n const [users, setUsers] = useState(defaultUsers);\n\n return (\n
\n
\n {/* Controls */}\n
\n
\n setBilling(\"annual\")}\n >\n Annually (Save 20%)\n \n setBilling(\"monthly\")}\n >\n Monthly\n \n
\n\n
\n Users:\n setUsers(Math.max(1, users - 1))}\n >\n \n \n {users}\n setUsers(users + 1)}\n >\n \n \n
\n
\n\n {/* Grid */}\n
\n {plans.map((plan) => (\n \n ))}\n
\n
\n
\n );\n}\n", "type": "registry:ui", "target": "components/ruixen/pricing-with-user-scaling.tsx" } ] }