{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "pulsing-border-pricing",
  "title": "Pulsing Border Pricing",
  "description": "A three-tier pricing section with a billing toggle and a pulsing glow around the featured plan.",
  "dependencies": [
    "@paper-design/shaders-react",
    "lucide-react"
  ],
  "registryDependencies": [
    "button"
  ],
  "files": [
    {
      "path": "registry/shaders/pulsing-border-pricing/pulsing-border-pricing.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { PulsingBorder } from \"@paper-design/shaders-react\"\nimport { CheckIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { buttonVariants } from \"@/components/ui/button\"\n\n// How far (in px) the glow bleeds outside the featured plan. Matches the gap\n// between plans so it fades out right at the neighbouring cards.\nconst GLOW = 32\n\ntype Billing = \"monthly\" | \"yearly\"\n\ntype Plan = {\n  name: string\n  description: string\n  /** A number is shown as a price per month. A string is shown as is. */\n  price: Record<Billing, number | string>\n  features: string[]\n  action: { label: string; href: string }\n  /** Wraps the plan in the pulsing glow. */\n  featured?: boolean\n  badge?: string\n}\n\nconst DEFAULT_PLANS: Plan[] = [\n  {\n    name: \"Hobby\",\n    description: \"For side projects and trying things out.\",\n    price: { monthly: 0, yearly: 0 },\n    features: [\n      \"1 project\",\n      \"10k monthly visitors\",\n      \"Basic analytics\",\n      \"Community support\",\n    ],\n    action: { label: \"Start for free\", href: \"#\" },\n  },\n  {\n    name: \"Pro\",\n    description: \"For growing teams that ship every week.\",\n    price: { monthly: 24, yearly: 19 },\n    features: [\n      \"Unlimited projects\",\n      \"250k monthly visitors\",\n      \"Advanced analytics\",\n      \"Custom domains\",\n      \"Priority email support\",\n    ],\n    action: { label: \"Start free trial\", href: \"#\" },\n    featured: true,\n    badge: \"Most popular\",\n  },\n  {\n    name: \"Enterprise\",\n    description: \"For organizations with advanced security needs.\",\n    price: { monthly: \"Custom\", yearly: \"Custom\" },\n    features: [\n      \"Unlimited everything\",\n      \"SSO and SCIM\",\n      \"99.99% uptime SLA\",\n      \"Dedicated success manager\",\n    ],\n    action: { label: \"Contact sales\", href: \"#\" },\n  },\n]\n\ntype PulsingBorderPricingProps = React.ComponentProps<\"section\"> & {\n  eyebrow?: string\n  title?: string\n  description?: string\n  plans?: Plan[]\n  currency?: string\n  /** Shown next to the yearly option, e.g. \"Save 20%\". */\n  yearlyNote?: string\n  defaultBilling?: Billing\n  colors?: string[]\n  speed?: number\n}\n\nfunction PulsingBorderPricing({\n  eyebrow = \"Pricing\",\n  title = \"Simple pricing that grows with you\",\n  description = \"Start for free, upgrade when you need more. No hidden fees, cancel anytime.\",\n  plans = DEFAULT_PLANS,\n  currency = \"$\",\n  yearlyNote = \"Save 20%\",\n  defaultBilling = \"monthly\",\n  colors = [\"#0dc1fd\", \"#d915ef\", \"#ff3f2ecc\"],\n  speed = 1,\n  className,\n  ...props\n}: PulsingBorderPricingProps) {\n  const [billing, setBilling] = React.useState(defaultBilling)\n\n  return (\n    <section\n      data-slot=\"pulsing-border-pricing\"\n      className={cn(\n        \"relative flex w-full flex-col items-center gap-12 overflow-hidden bg-background px-6 py-24 text-foreground md:px-12\",\n        className\n      )}\n      {...props}\n    >\n      <div className=\"flex max-w-2xl flex-col items-center gap-4 text-center\">\n        <span className=\"font-mono text-[11px] tracking-widest text-muted-foreground uppercase\">\n          {eyebrow}\n        </span>\n        <h2 className=\"font-heading text-3xl leading-tight tracking-tight text-balance sm:text-5xl\">\n          {title}\n        </h2>\n        <p className=\"max-w-md text-base text-pretty text-muted-foreground\">\n          {description}\n        </p>\n        <div className=\"mt-2 flex border p-0.5\">\n          {([\"monthly\", \"yearly\"] as const).map((option) => (\n            <button\n              key={option}\n              type=\"button\"\n              aria-pressed={billing === option}\n              onClick={() => setBilling(option)}\n              className=\"flex h-8 items-center gap-2 px-3 text-xs font-medium text-muted-foreground capitalize transition-colors outline-none hover:text-foreground focus-visible:ring-1 focus-visible:ring-ring aria-pressed:bg-foreground aria-pressed:text-background\"\n            >\n              {option}\n              {option === \"yearly\" && yearlyNote && (\n                <span className=\"font-mono text-[10px] tracking-wider uppercase opacity-70\">\n                  {yearlyNote}\n                </span>\n              )}\n            </button>\n          ))}\n        </div>\n      </div>\n      <div className=\"grid w-full max-w-5xl gap-8 lg:grid-cols-3\">\n        {plans.map((plan) => {\n          const card = (\n            <PlanCard plan={plan} billing={billing} currency={currency} />\n          )\n\n          return plan.featured ? (\n            <Glow key={plan.name} colors={colors} speed={speed}>\n              {card}\n            </Glow>\n          ) : (\n            <div key={plan.name} className=\"border\">\n              {card}\n            </div>\n          )\n        })}\n      </div>\n    </section>\n  )\n}\n\nfunction PlanCard({\n  plan,\n  billing,\n  currency,\n}: {\n  plan: Plan\n  billing: Billing\n  currency: string\n}) {\n  const price = plan.price[billing]\n  const isNumber = typeof price === \"number\"\n\n  return (\n    <div className=\"flex h-full flex-col gap-8 bg-card p-6 text-card-foreground\">\n      <div className=\"flex flex-col gap-2\">\n        <div className=\"flex items-center justify-between gap-2\">\n          <h3 className=\"font-heading text-lg leading-tight\">{plan.name}</h3>\n          {plan.badge && (\n            <span className=\"border px-2 py-0.5 font-mono text-[10px] tracking-widest text-muted-foreground uppercase\">\n              {plan.badge}\n            </span>\n          )}\n        </div>\n        <p className=\"min-h-10 text-sm text-muted-foreground\">\n          {plan.description}\n        </p>\n      </div>\n      <div className=\"flex flex-col gap-1\">\n        <p className=\"flex items-baseline gap-1\">\n          <span className=\"font-heading text-4xl tracking-tight tabular-nums\">\n            {isNumber ? `${currency}${price}` : price}\n          </span>\n          {isNumber && (\n            <span className=\"text-sm text-muted-foreground\">/ month</span>\n          )}\n        </p>\n        <p className=\"h-4 text-xs text-muted-foreground\">\n          {isNumber && price > 0 && billing === \"yearly\" && \"Billed yearly\"}\n        </p>\n      </div>\n      <a\n        href={plan.action.href}\n        className={cn(\n          buttonVariants({\n            size: \"lg\",\n            variant: plan.featured ? \"default\" : \"outline\",\n          }),\n          \"w-full\"\n        )}\n      >\n        {plan.action.label}\n      </a>\n      <ul className=\"flex flex-col gap-3 text-sm\">\n        {plan.features.map((feature) => (\n          <li key={feature} className=\"flex items-start gap-2.5\">\n            <CheckIcon className=\"mt-0.5 size-4 shrink-0 text-muted-foreground\" />\n            {feature}\n          </li>\n        ))}\n      </ul>\n    </div>\n  )\n}\n\nfunction Glow({\n  colors,\n  speed,\n  children,\n}: {\n  colors: string[]\n  speed: number\n  children: React.ReactNode\n}) {\n  const ref = React.useRef<HTMLDivElement>(null)\n  const [size, setSize] = React.useState({ width: 0, height: 0 })\n\n  React.useEffect(() => {\n    const element = ref.current\n    if (!element) return\n\n    const observer = new ResizeObserver(([entry]) => {\n      const { width, height } = entry.contentRect\n      setSize({ width: width + GLOW * 2, height: height + GLOW * 2 })\n    })\n    observer.observe(element)\n\n    return () => observer.disconnect()\n  }, [])\n\n  // The shader expresses margins as a fraction of the canvas, so convert the\n  // pixel outset into fractions to keep the border glued to the card edges.\n  const marginX = size.width ? GLOW / size.width : 0\n  const marginY = size.height ? GLOW / size.height : 0\n\n  return (\n    <div ref={ref} className=\"relative isolate\">\n      {size.width > 0 && (\n        <PulsingBorder\n          aria-hidden\n          className=\"pointer-events-none absolute -z-10\"\n          style={{ inset: -GLOW }}\n          colors={colors}\n          colorBack=\"#00000000\"\n          speed={speed}\n          roundness={0}\n          thickness={0.05}\n          softness={0.75}\n          intensity={0.3}\n          bloom={0.3}\n          spots={4}\n          spotSize={0.5}\n          pulse={0.2}\n          smoke={0.3}\n          smokeSize={0.5}\n          scale={1}\n          marginLeft={marginX}\n          marginRight={marginX}\n          marginTop={marginY}\n          marginBottom={marginY}\n        />\n      )}\n      {children}\n    </div>\n  )\n}\n\nexport { PulsingBorderPricing, type Plan }\n",
      "type": "registry:component"
    }
  ],
  "categories": [
    "sections",
    "pricing"
  ],
  "type": "registry:block"
}