{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "beam-background", "title": "Beam Background", "description": "Canvas-based animated light beam sweeps for dark hero sections", "files": [ { "path": "registry/pioneerui/beam-background.tsx", "content": "\"use client\"\n\nimport React, { useId } from \"react\"\nimport { motion } from \"motion/react\"\nimport { cn } from \"@/lib/utils\"\n\ninterface BeamConfig {\n left: string\n width: number\n duration: number\n delay: number\n color: string\n opacity: number\n height: string\n}\n\nconst DEFAULT_BEAMS: BeamConfig[] = [\n { left: \"8%\", width: 40, duration: 8, delay: 0, color: \"#6366f1\", opacity: 0.55, height: \"60%\" },\n { left: \"20%\", width: 25, duration: 11, delay: 2.5, color: \"#a855f7\", opacity: 0.4, height: \"45%\" },\n { left: \"35%\", width: 55, duration: 7, delay: 1, color: \"#3b82f6\", opacity: 0.45, height: \"70%\" },\n { left: \"50%\", width: 30, duration: 13, delay: 3.5, color: \"#ec4899\", opacity: 0.35, height: \"50%\" },\n { left: \"62%\", width: 50, duration: 9, delay: 0.5, color: \"#8b5cf6\", opacity: 0.5, height: \"65%\" },\n { left: \"76%\", width: 20, duration: 12, delay: 2, color: \"#06b6d4\", opacity: 0.4, height: \"40%\" },\n { left: \"88%\", width: 45, duration: 6, delay: 4, color: \"#6366f1\", opacity: 0.45, height: \"55%\" },\n]\n\nexport interface BeamBackgroundProps extends React.HTMLAttributes {\n children?: React.ReactNode\n beams?: Partial[]\n}\n\nfunction SingleBeam({ beam, id }: { beam: BeamConfig; id: string }) {\n const gradientId = `beam-grad-${id}`\n\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n )\n}\n\nexport function BeamBackground({\n children,\n className,\n beams,\n ...props\n}: BeamBackgroundProps) {\n const baseId = useId()\n const resolvedBeams: BeamConfig[] = beams\n ? beams.map((b, i) => ({ ...DEFAULT_BEAMS[i % DEFAULT_BEAMS.length], ...b }))\n : DEFAULT_BEAMS\n\n return (\n \n
\n {resolvedBeams.map((beam, i) => (\n \n ))}\n
\n {/* Bottom fade */}\n
\n
{children}
\n
\n )\n}\n", "type": "registry:ui", "target": "components/pioneerui/beam-background.tsx" } ], "type": "registry:ui" }