{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "pricing-1", "type": "registry:block", "description": "Responsive pricing section with frequency toggle, tooltips, and highlightable plans.", "dependencies": [ "motion" ], "registryDependencies": [ "button", "tooltip" ], "files": [ { "path": "registry/blocks/pricing/1/pricing-section.tsx", "content": "\"use client\";\nimport { CheckCircleIcon, StarIcon } from \"lucide-react\";\nimport Link from \"next/link\";\nimport React from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"@/components/ui/tooltip\";\nimport { cn } from \"@/lib/utils\";\nimport { type FREQUENCY, FrequencyToggle } from \"./frequency-toggle\";\n\nexport type Plan = {\n name: string;\n info: string;\n price: {\n monthly: number;\n yearly: number;\n };\n features: {\n text: string;\n tooltip?: string;\n }[];\n btn: {\n text: string;\n href: string;\n };\n highlighted?: boolean;\n};\n\ninterface PricingSectionProps extends React.ComponentProps<\"div\"> {\n plans: Plan[];\n heading: string;\n description?: string;\n}\n\nexport function PricingSection({\n plans,\n heading,\n description,\n ...props\n}: PricingSectionProps) {\n const [frequency, setFrequency] = React.useState<\"monthly\" | \"yearly\">(\n \"monthly\"\n );\n\n return (\n
\n {description}\n
\n )}\n\n
\n {Math.round(\n ((plan.price.monthly * 12 - plan.price.yearly) /\n plan.price.monthly /\n 12) *\n 100\n )}\n % off\n
\n )}\n{plan.info}
\n\n {feature.text}\n
\n{feature.tooltip}
\n