{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"beam-sweep-backdrop","type":"registry:component","title":"Beam Sweep Backdrop","description":"Slow conic light beams rotating behind content, CSS-only and compositor-friendly.","dependencies":[],"registryDependencies":[],"files":[{"path":"components/viberdy/beam-sweep-backdrop.tsx","content":"\"use client\";\n\nexport function BeamSweepBackdrop({\n  children,\n  beams = 3,\n  speed = 18,\n  blur = 40,\n  vignette = true,\n}: {\n  children?: React.ReactNode;\n  beams?: number;\n  speed?: number;\n  blur?: number;\n  /** Radial fade that pulls the beams away from the edges. */\n  vignette?: boolean;\n}) {\n  return (\n    // `isolate` is load-bearing: the beams sit at a negative z-index, and\n    // position:relative alone does NOT create a stacking context, so without\n    // it they escape behind the page background entirely.\n    <div className=\"relative isolate overflow-hidden bg-[#07080b]\">\n      {/*\n       * Own keyframes rather than Tailwind's `spin`: that one is only emitted\n       * when an animate-spin utility appears in the scanned source, which a\n       * copied-out component cannot rely on. Static by design — per-instance\n       * duration and direction go through inline style, never interpolated here.\n       */}\n      <style>{\"@keyframes beam-sweep-rotate { to { transform: translate(-50%, -50%) rotate(360deg); } }\"}</style>\n\n      {Array.from({ length: beams }).map((_, i) => (\n        <div\n          key={i}\n          aria-hidden\n          className=\"absolute left-1/2 top-1/2 -z-10 aspect-square w-[180%] -translate-x-1/2 -translate-y-1/2\"\n          style={{\n            background:\n              \"conic-gradient(from \" +\n              i * 120 +\n              \"deg, transparent 0deg, #3d7bff \" +\n              (14 + i * 6) +\n              \"deg, transparent \" +\n              (34 + i * 8) +\n              \"deg, transparent 360deg)\",\n            filter: \"blur(\" + blur + \"px)\",\n            opacity: 0.28 - i * 0.06,\n            // The keyframe carries the -50%/-50% translate itself, because an\n            // animation on transform replaces the class-based translate rather\n            // than composing with it.\n            animation:\n              \"beam-sweep-rotate \" +\n              (speed + i * 7) +\n              \"s linear infinite\" +\n              (i % 2 ? \" reverse\" : \"\"),\n          }}\n        />\n      ))}\n\n      {vignette && (\n        <div\n          aria-hidden\n          className=\"absolute inset-0 -z-10\"\n          style={{\n            background:\n              \"radial-gradient(circle at 50% 50%, transparent 30%, #07080b 78%)\",\n          }}\n        />\n      )}\n\n      <div className=\"relative\">{children}</div>\n    </div>\n  );\n}\n","type":"registry:component","target":"components/viberdy/beam-sweep-backdrop.tsx"}],"meta":{"tier":"free","tags":["background","beams","conic-gradient","ambient"],"href":"https://viberdy.dev/library/beam-sweep-backdrop","aiPrompt":"Create a React + Tailwind component named BeamSweepBackdrop — slow rotating light beams behind page content.\n\nBehavior:\n- Wraps children. Renders N layers (beams prop), each a large square div centered in the container at a negative z-index.\n- Each layer's background is a conic-gradient producing one narrow wedge of accent color against transparent, starting at a different angle per layer.\n- Each layer is heavily blurred and rotates slowly, at a DIFFERENT duration per layer and with alternating direction, so the composite pattern never visibly repeats on a short loop.\n- A radial vignette on top fades the beams out toward the edges.\n\nCritical implementation notes:\n- Put \"isolate\" on the wrapper. position: relative alone does NOT create a stacking context, so without it the negative-z-index beams escape behind the page background.\n- Define your OWN @keyframes (e.g. beam-sweep-rotate) in a static <style> tag rather than relying on Tailwind's \"spin\" — that keyframe is only emitted when an animate-spin utility appears in the scanned source, which a copied-out component cannot assume.\n- The keyframe must include the centering translate: an animation on \"transform\" REPLACES the class-based -translate-x-1/2 -translate-y-1/2 rather than composing with it, so write \"transform: translate(-50%, -50%) rotate(360deg)\".\n- Do not interpolate values into the <style> block. Per-instance duration/direction belong in inline style.\n- CSS only — no canvas, no requestAnimationFrame. Only transform and opacity animate, so it stays on the compositor.\n\nProps: children (ReactNode), beams (number), speed (seconds for the base layer), blur (px).\n\nOutput a single self-contained \"use client\" component.","license":"https://viberdy.dev/license"}}