{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"edge-fog","type":"registry:ui","title":"Edge Fog","description":"A progressive edge blur built from stacked, masked backdrop-filter layers. Drop it over any scrolling area.","dependencies":[],"registryDependencies":["utils"],"files":[{"path":"registry/ui/edge-fog.tsx","type":"registry:ui","content":"\"use client\";\n\nimport type { CSSProperties } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface EdgeFogProps {\n  /** Edge the blur is anchored to. */\n  position?: \"top\" | \"bottom\" | \"left\" | \"right\";\n  /** Blur in px at the very edge. */\n  strength?: number;\n  /** Thickness of the blurred band in px. */\n  height?: number;\n  /** Stacked layers; more is smoother, fewer is cheaper. */\n  layers?: number;\n  /** Ramp the blur exponentially (natural falloff) instead of linearly. */\n  exponential?: boolean;\n  /** Also fade toward the background color at the edge. */\n  fade?: boolean;\n  className?: string;\n}\n\nexport function EdgeFog({\n  position = \"bottom\",\n  strength = 12,\n  height = 140,\n  layers = 6,\n  exponential = true,\n  fade = true,\n  className,\n}: EdgeFogProps) {\n  const vertical = position === \"top\" || position === \"bottom\";\n  const n = Math.max(1, Math.round(layers));\n  const dir = `to ${position}`;\n  const box: CSSProperties = vertical\n    ? { left: 0, right: 0, [position]: 0, height }\n    : { top: 0, bottom: 0, [position]: 0, width: height };\n\n  return (\n    <div aria-hidden className={cn(\"pointer-events-none absolute z-10\", className)} style={box}>\n      {Array.from({ length: n }, (_, i) => {\n        // Each layer ramps in over its own slice and stays on to the edge, so blur compounds toward it.\n        const blur = exponential ? strength * 2 ** (i + 1 - n) : (strength * (i + 1)) / n;\n        const from = (i / n) * 100;\n        const to = ((i + 1) / n) * 100;\n        const mask = `linear-gradient(${dir}, transparent ${from}%, #000 ${to}%)`;\n        return (\n          <div\n            key={i}\n            style={{\n              position: \"absolute\",\n              inset: 0,\n              backdropFilter: `blur(${blur.toFixed(2)}px)`,\n              WebkitBackdropFilter: `blur(${blur.toFixed(2)}px)`,\n              maskImage: mask,\n              WebkitMaskImage: mask,\n            }}\n          />\n        );\n      })}\n      {fade && (\n        <div\n          className=\"absolute inset-0\"\n          style={{\n            background: `linear-gradient(${dir}, transparent 20%, color-mix(in oklab, var(--background) 70%, transparent))`,\n          }}\n        />\n      )}\n    </div>\n  );\n}\n"}]}